diff --git a/.github/workflows/publish-on-pypi.yml b/.github/workflows/publish-on-pypi.yml index d5279d1d..ea049a69 100644 --- a/.github/workflows/publish-on-pypi.yml +++ b/.github/workflows/publish-on-pypi.yml @@ -8,6 +8,9 @@ on: jobs: build-and-upload: runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write steps: - name: Check out the release commit @@ -22,10 +25,8 @@ jobs: - name: Build sdist and wheel run: | python -m build - - name: Publish to PyPI - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + - name: Check the distribution run: | python -m twine check --strict dist/* - python -m twine upload dist/* + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # v1.14.1