From c93349c350e35af41ead6f27cb47b00dc491154f Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Tue, 19 Sep 2023 16:20:18 -0700 Subject: [PATCH] Convert workflow to trusted PyPI publisher --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d0131fb..e273e5c0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -238,6 +238,9 @@ jobs: name: Deploy artifacts to PyPI needs: [wheel_sdist_linux, test_linux, test_macos, test_windows] runs-on: ubuntu-latest + environment: release + permissions: + id-token: write # mandatory for PyPI publishing if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') steps: - uses: actions/download-artifact@v3 @@ -245,11 +248,8 @@ jobs: name: artifact path: dist - - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.TOKEN_PYPI }} - # repository_url: https://test.pypi.org/legacy/ + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 create_release: name: Create GitHub release