Skip to content

Commit

Permalink
Use "trusted publisher" from PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
davecwright3 committed Feb 19, 2024
1 parent f397b29 commit 8320b79
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/publish_to_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,20 @@ jobs:
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/ .

# - name: Publish distribution to Test PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
pypi-publish:
needs: ['build_wheels, make_sdist']
environment: 'publish'

name: upload release to PyPI
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v3

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: artifact/

0 comments on commit 8320b79

Please sign in to comment.