Skip to content

Commit

Permalink
prepare for trusted publisher releases to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Oct 5, 2024
1 parent 19b54d0 commit d319d7d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/build_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
needs: [check_source, build_linux]
permissions:
id-token: write
steps:
- name: Set up Python
uses: actions/setup-python@v5
Expand All @@ -159,15 +161,11 @@ jobs:
- name: Publish package (to TestPyPI)
if: github.event_name == 'workflow_dispatch'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
run: twine upload --repository testpypi dist/*
uses: pypa/[email protected]
with:
repository-url: https://test.pypi.org/legacy/

- name: Publish to PyPi
# only upload distributions to PyPi when triggered by a published release
if: github.event_name == 'release'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*
uses: pypa/[email protected]

0 comments on commit d319d7d

Please sign in to comment.