From 983e036fa34156a518ffb37919a7063847d8cd3e Mon Sep 17 00:00:00 2001 From: Keshav Priyadarshi Date: Tue, 17 Mar 2026 19:15:14 +0530 Subject: [PATCH] Publish to pypi using trusted publisher Signed-off-by: Keshav Priyadarshi --- .github/workflows/pypi-release.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 1169c2e..3846827 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -37,7 +37,7 @@ jobs: run: python -m build --sdist --wheel --outdir dist/ - name: Upload built archives - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: pypi_archives path: dist/* @@ -51,7 +51,7 @@ jobs: steps: - name: Download built archives - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: pypi_archives path: dist @@ -69,16 +69,17 @@ jobs: needs: - create-gh-release runs-on: ubuntu-24.04 + environment: pypi-publish + permissions: + id-token: write steps: - name: Download built archives - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: pypi_archives - path: dist + path: dist/ - name: Publish to PyPI - if: startsWith(github.ref, 'refs/tags') + if: startsWith(github.ref, 'refs/tags/') uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }}