Skip to content

Commit be5d6ac

Browse files
authored
Utilize PyPI's trusted publishing (#1107)
PyPI and Test PyPI recently introduced trusted publshing for repositories using GitHub Actions to publish. Changes having already been made on the PyPI and Test PyPI sites to trust our GitHub actions. https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/ Signed-off-by: Eric Brown <[email protected]>
1 parent c3a07e5 commit be5d6ac

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/publish-to-pypi.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ jobs:
66
build-n-publish:
77
name: Build and publish to PyPI
88
runs-on: ubuntu-latest
9+
permissions:
10+
# IMPORTANT: this permission is mandatory for trusted publishing
11+
id-token: write
912
steps:
1013
- uses: actions/checkout@v4
1114
with:
@@ -25,5 +28,3 @@ jobs:
2528
- name: Publish distribution to PyPI
2629
if: startsWith(github.ref, 'refs/tags')
2730
uses: pypa/gh-action-pypi-publish@release/v1
28-
with:
29-
password: ${{ secrets.PYPI_PASSWORD }}

.github/workflows/publish-to-test-pypi.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ jobs:
66
build-n-publish:
77
name: Build and publish to Test PyPI
88
runs-on: ubuntu-latest
9+
permissions:
10+
# IMPORTANT: this permission is mandatory for trusted publishing
11+
id-token: write
912
steps:
1013
- uses: actions/checkout@v4
1114
with:
@@ -25,5 +28,4 @@ jobs:
2528
- name: Publish distribution to Test PyPI
2629
uses: pypa/gh-action-pypi-publish@release/v1
2730
with:
28-
password: ${{ secrets.TEST_PYPI_PASSWORD }}
29-
repository_url: https://test.pypi.org/legacy/
31+
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)