Skip to content

Commit

Permalink
Merge pull request #1930 from minrk/trusted-github
Browse files Browse the repository at this point in the history
upload releases with trusted publisher
  • Loading branch information
minrk authored Feb 16, 2024
2 parents ecf6db5 + 8eee6f7 commit 6c9464e
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ env:

jobs:
sdist:
permissions:
id-token: write
environment: release
runs-on: ubuntu-22.04

steps:
Expand Down Expand Up @@ -56,15 +59,13 @@ jobs:
pytest -v tools/test_sdist.py

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/')
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install twine
twine upload --skip-existing dist/*.tar.gz

wheel:
permissions:
id-token: write
environment: release
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
name: wheel-${{ matrix.name }}

Expand Down Expand Up @@ -174,10 +175,7 @@ jobs:
if-no-files-found: error

- name: Publish wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/')
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install twine
twine upload --skip-existing wheelhouse/*
with:
packages-dir: wheelhouse/

0 comments on commit 6c9464e

Please sign in to comment.