Skip to content

Commit

Permalink
CI: Use trusted publisher instead of token for PyPI publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCrews committed Aug 16, 2023
1 parent 4ffebe0 commit ba446cd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
# Must match the PyPI trusted publisher:
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
environment: publish
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up latest Python 3
Expand All @@ -19,10 +25,7 @@ jobs:
- name: Build package
run: make build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.4.1
with:
user: "__token__"
password: ${{ secrets.PYPI_API_TOKEN }}
uses: pypa/gh-action-pypi-publish@release/v1
- name: Create GitHub Release
uses: actions/create-release@v1
env:
Expand Down

0 comments on commit ba446cd

Please sign in to comment.