diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1f4fbdd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: release + +# Publishes to PyPI when a v* tag is pushed. No API token exists anywhere: +# the job authenticates to PyPI over OIDC (Trusted Publishing), so a leaked +# repo secret cannot be used to publish, because there is no secret. +on: + push: + tags: ["v*"] + +jobs: + publish: + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write # OIDC for PyPI trusted publishing -- no token on disk + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + - run: pip install build twine + - run: python -m build + - run: twine check dist/* + - uses: pypa/gh-action-pypi-publish@release/v1