Skip to content

Commit ff2b92b

Browse files
authored
feat/publish: add trusted publisher support to CI (#271)
Signed-off-by: K.B.Dharun Krishna <[email protected]>
1 parent bb2be0c commit ff2b92b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/publish.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
1+
# This workflow will upload a Python Package using Trusted Publishers automatically when a release is created
22
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
# and https://docs.pypi.org/trusted-publishers/using-a-publisher/.
34

45
name: Upload Python Package
56

@@ -8,9 +9,17 @@ on:
89
types: [created]
910

1011
jobs:
11-
deploy:
12-
12+
pypi-publish:
1313
runs-on: ubuntu-latest
14+
15+
environment:
16+
name: pypi
17+
url: https://pypi.org/project/tldr/
18+
19+
permissions:
20+
contents: read
21+
id-token: write # Required for accessing OpenID Connect (OIDC) token for PyPI trusted publisher
22+
1423
steps:
1524
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1625

@@ -57,6 +66,3 @@ jobs:
5766
5867
- name: Publish package
5968
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
60-
with:
61-
user: __token__
62-
password: ${{ secrets.PYPI_PASSWORD }}

0 commit comments

Comments
 (0)