From dd601c33212aee870b8c4be42bc68a15bf709223 Mon Sep 17 00:00:00 2001 From: Andrey Kislyuk Date: Fri, 27 Dec 2024 17:15:09 -0800 Subject: [PATCH] Use trusted publishing --- .github/workflows/release.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3c15e6f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,21 @@ +name: Publish release to PyPI + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + pypi-publish: + name: Build and upload release to PyPI + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + environment: release + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + - run: python -m build + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1