You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/pythonpublish.yml
+15-6Lines changed: 15 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,10 @@
2
2
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3
3
name: Upload Python Package
4
4
5
+
permissions:
6
+
id-token: write
7
+
contents: read
8
+
5
9
"on":
6
10
release:
7
11
types:
@@ -10,6 +14,9 @@ name: Upload Python Package
10
14
jobs:
11
15
deploy:
12
16
runs-on: ubuntu-latest
17
+
permissions:
18
+
id-token: write
19
+
contents: read
13
20
14
21
steps:
15
22
- name: Checkout
@@ -25,9 +32,11 @@ jobs:
25
32
python -m pip install --upgrade build
26
33
python -m build
27
34
- name: Publish package to PyPI
28
-
# Pin to a specific released version to avoid resolving issues with
29
-
# floating tags. Using v1.0.6 which is a stable release at time of
30
-
# update; adjust if newer stable tag is preferred.
31
-
uses: pypa/gh-action-pypi-publish@v1.0.6
32
-
with:
33
-
password: ${{ secrets.PYPI_TOKEN }}
35
+
# Use the action's release branch to follow the stable v1 releases.
36
+
# The action recommends `release/v1` or a specific tag; `release/v1`
37
+
# will resolve to the latest v1.x release.
38
+
# With `permissions.id-token: write` and a configured trusted repository
39
+
# on PyPI, the action will use OIDC token-based authentication and
40
+
# no repository secret is required. If you prefer an API token, add
41
+
# `password: ${{ secrets.PYPI_TOKEN }}` under `with` instead.
0 commit comments