-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Use PyPI OIDC to publish (#19)
- Loading branch information
1 parent
c7a6cf3
commit 7f81f0b
Showing
1 changed file
with
7 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,11 @@ name: Upload Python Package | |
|
||
on: | ||
release: | ||
types: [created] | ||
types: [published] # Trigger only when a release is published, not when a release is drafted | ||
|
||
permissions: | ||
contents: write # Needed to upload artifacts to the release | ||
id-token: write # Needed for OIDC PyPI publishing | ||
|
||
jobs: | ||
build_deploy: | ||
|
@@ -35,7 +39,5 @@ jobs: | |
tag: ${{ github.ref }} | ||
overwrite: true | ||
file_glob: true | ||
- name: Deploy to PyPI | ||
run: | | ||
poetry publish -r testpypi -u "__token__" -p "${{ secrets.TEST_PYPI_TOKEN }}" | ||
poetry publish -u "__token__" -p "${{ secrets.PYPI_TOKEN }}" | ||
- name: Publish | ||
uses: pypa/[email protected] |