Skip to content

Commit

Permalink
Use pypa/gh-actions-pypi-publish for trusted publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
coldfix committed Dec 27, 2024
1 parent 7c2b2fa commit 54c1dde
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,12 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')

steps:
- uses: actions/setup-python@v5
with:
python-version: '3.x'
environment:
name: pypi
permissions:
id-token: write

steps:
- name: Fetch built distributions
uses: actions/download-artifact@v4
with:
Expand All @@ -389,14 +390,8 @@ jobs:
mv dist/dist-*/*.whl dist/
mv dist/dist-linux-manylinux2014_x86_64/*.tar.gz dist/
- name: Install twine
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

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
Expand Down

0 comments on commit 54c1dde

Please sign in to comment.