Skip to content

Commit ec9d08c

Browse files
committed
Update PyPI publishing workflow to use trusted publishing
1 parent d225a9b commit ec9d08c

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
jobs:
88
deploy:
99
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1012
steps:
1113
- uses: actions/checkout@v3
1214
- name: Set up Python
@@ -16,11 +18,9 @@ jobs:
1618
- name: Install dependencies
1719
run: |
1820
python -m pip install --upgrade pip
19-
pip install build twine
20-
- name: Build and publish
21-
env:
22-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
24-
run: |
25-
python -m build
26-
twine upload dist/*
21+
pip install build
22+
- name: Build package
23+
run: python -m build
24+
- name: Publish package
25+
uses: pypa/gh-action-pypi-publish@release/v1
26+
# No credentials needed for trusted publishing

0 commit comments

Comments
 (0)