Skip to content

Commit

Permalink
Use trusted publishers for PyPI releases
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwhite committed Jan 15, 2025
1 parent 6c5d6b3 commit 5f75ba2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:
build-artifacts:
if: github.repository == 'cubed-dev/cubed'
runs-on: ubuntu-latest
environment: pypi
permissions:
# IMPORTANT: this permission is mandatory for Trusted Publishing
id-token: write
steps:
- name: Checkout source
uses: actions/checkout@v3
Expand Down Expand Up @@ -43,13 +47,17 @@ jobs:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
verbose: true

upload-to-pypi:
needs: build-artifacts
if: github.event_name == 'release'
runs-on: ubuntu-latest
environment: pypi
permissions:
# IMPORTANT: this permission is mandatory for Trusted Publishing
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
Expand All @@ -59,4 +67,4 @@ jobs:
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true

0 comments on commit 5f75ba2

Please # to comment.