Skip to content

Commit 542f391

Browse files
committed
use openID connect to authenticate PyPI
1 parent 2c9948a commit 542f391

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/publish-to-pypi.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ on:
55
types: [published]
66

77
jobs:
8-
deploy:
8+
pypi-publish:
9+
name: upload release to PyPI
910
runs-on: ubuntu-latest
11+
environment: release
12+
permissions:
13+
id-token: write
1014
steps:
1115
- uses: actions/checkout@v2
1216
- name: Set up Python
@@ -17,9 +21,8 @@ jobs:
1721
run: |
1822
python -m pip install --upgrade pip
1923
pip install poetry
20-
- name: Build and publish
21-
env:
22-
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
24+
- name: Build
2325
run: |
2426
poetry build
25-
poetry publish --username __token__ --password $PYPI_API_TOKEN
27+
- name: Publish package distributions to PyPI
28+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)