Publish to PyPI with a Trusted Publisher

This commit is contained in:
Hugo van Kemenade 2023-04-18 06:08:52 -06:00
parent f0ea480334
commit 56fc297371

View file

@ -14,6 +14,10 @@ jobs:
if: github.repository_owner == 'pylast'
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3
with:
@ -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_password }}
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository-url: https://test.pypi.org/legacy/