Skip to content

Commit aca4847

Browse files
committed
Update release workflow to use PyPI Trusted Publisher with OIDC
1 parent ae603e1 commit aca4847

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
jobs:
1010
build-and-publish:
1111
runs-on: ubuntu-latest
12+
# Enable OIDC token permissions for Trusted Publisher
13+
permissions:
14+
id-token: write
1215

1316
steps:
1417
- name: Checkout repository
@@ -23,13 +26,11 @@ jobs:
2326
run: python -m pip install --upgrade pip
2427

2528
- name: Install build tools
26-
run: pip install build twine
29+
run: pip install build
2730

2831
- name: Build the package
2932
run: python -m build
3033

31-
- name: Publish package to PyPI
32-
env:
33-
TWINE_USERNAME: __token__
34-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
35-
run: twine upload dist/* --non-interactive --skip-existing
34+
- name: Publish package distributions to PyPI using Trusted Publisher
35+
# This action uses OIDC to authenticate without API tokens
36+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)