Skip to content

Commit f85ff54

Browse files
committed
ci: switch to PyPI trusted publishing (OIDC)
1 parent 5c8c6f3 commit f85ff54

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

.github/workflows/python-publish.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,27 @@ on:
77

88
permissions:
99
contents: read
10-
pull-requests: read # to detect changes files
10+
id-token: write # Required for PyPI trusted publishing (OIDC)
1111

1212
jobs:
1313
pypi:
14-
name: Pypi
14+
name: Publish to PyPI
1515
runs-on: ubuntu-latest
16+
environment: pypi
1617
steps:
1718
- name: Checkout
1819
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
20+
1921
- name: Setup
2022
uses: descope/.github/.github/actions/python/poetry/setup@main
2123
with:
2224
python-version: "3.11"
23-
- name: Autobump version
24-
run: |
25-
poetry version $(git describe --tags --abbrev=0)
25+
26+
- name: Set version from tag
27+
run: poetry version $(git describe --tags --abbrev=0)
28+
2629
- name: Build
2730
uses: descope/.github/.github/actions/python/poetry/build@main
28-
- name: Publish
29-
uses: descope/.github/.github/actions/python/poetry/publish@main
30-
with:
31-
token: ${{ secrets.PYPI_TOKEN }}
31+
32+
- name: Publish to PyPI
33+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)