Skip to content

Commit 5f75ba2

Browse files
committed
Use trusted publishers for PyPI releases
1 parent 6c5d6b3 commit 5f75ba2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
build-artifacts:
1212
if: github.repository == 'cubed-dev/cubed'
1313
runs-on: ubuntu-latest
14+
environment: pypi
15+
permissions:
16+
# IMPORTANT: this permission is mandatory for Trusted Publishing
17+
id-token: write
1418
steps:
1519
- name: Checkout source
1620
uses: actions/checkout@v3
@@ -43,13 +47,17 @@ jobs:
4347
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
4448
uses: pypa/gh-action-pypi-publish@release/v1
4549
with:
46-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
4750
repository-url: https://test.pypi.org/legacy/
51+
verbose: true
4852

4953
upload-to-pypi:
5054
needs: build-artifacts
5155
if: github.event_name == 'release'
5256
runs-on: ubuntu-latest
57+
environment: pypi
58+
permissions:
59+
# IMPORTANT: this permission is mandatory for Trusted Publishing
60+
id-token: write
5361
steps:
5462
- name: Download artifacts
5563
uses: actions/download-artifact@v4
@@ -59,4 +67,4 @@ jobs:
5967
- name: Publish distribution 📦 to PyPI
6068
uses: pypa/gh-action-pypi-publish@release/v1
6169
with:
62-
password: ${{ secrets.PYPI_API_TOKEN }}
70+
verbose: true

0 commit comments

Comments
 (0)