Skip to content

Commit 04f35a8

Browse files
committed
Update workflow to use PyPI Trusted Publisher framework
References: * https://docs.pypi.org/trusted-publishers/using-a-publisher/ * https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
1 parent 399d417 commit 04f35a8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ jobs:
5858
run: |
5959
poetry build
6060
61-
# Only push to PyPi when a tag is created starting with 'v'
61+
pypi-publish:
62+
needs: build
63+
environment: release
64+
permissions:
65+
# IMPORTANT: this permission is mandatory for trusted publishing
66+
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
67+
id-token: write
68+
steps:
6269
- name: Push to PyPi
63-
if: startsWith(github.ref, 'refs/tags/v')
64-
run: |
65-
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
66-
poetry publish
70+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)