Skip to content

Commit

Permalink
Use pypa/gh-actions-pypi-publish for releasing
Browse files Browse the repository at this point in the history
In order to support trusted publishing.

I believe twine doesn't support it yet, see:

pypa/twine#999
  • Loading branch information
coldfix committed Nov 23, 2023
1 parent e5948e2 commit a27e7fb
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/python-package.yml
Expand Up @@ -54,19 +54,14 @@ jobs:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v') && success()
environment:
name: pypi
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- run: pip install twine

- name: Publish PyPI package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*.whl dist/*.tar.gz
- uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit a27e7fb

Please sign in to comment.