Skip to content

Commit

Permalink
Publish to PyPI with a Trusted Publisher (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Apr 5, 2023
2 parents c7fe5a1 + 0c7f950 commit 696693b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
if: github.repository_owner == 'hugovk'
runs-on: ubuntu-latest

permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -39,13 +43,8 @@ jobs:
- name: Publish package to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/

0 comments on commit 696693b

Please sign in to comment.