Skip to content

Commit 0c47db7

Browse files
committed
Update pypi publish workflow to use Trusted Publisher
(cherry picked from commit 0115ab3)
1 parent a570e38 commit 0c47db7

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

.github/workflows/pypi-publish.yml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,42 @@ on:
88
types: [published]
99

1010
jobs:
11-
deploy:
11+
release-build:
1212

1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1717
- name: Set up Python
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v4
1919
with:
2020
python-version: "3.10"
21-
- name: Install dependencies
21+
- name: Install dependencies and build
2222
run: |
2323
python -m pip install --upgrade pip
2424
python -m pip install -r requirements.txt
25-
pip install twine build
26-
- name: Build and publish
27-
env:
28-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
29-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
30-
run: |
25+
pip install build
3126
python -m build
32-
twine upload dist/*
27+
28+
- name: upload windows dists
29+
uses: actions/upload-artifact@v3
30+
with:
31+
name: release-dists
32+
path: dist/
33+
34+
pypi-publish:
35+
runs-on: ubuntu-latest
36+
needs:
37+
- release-build
38+
permissions:
39+
id-token: write
40+
41+
steps:
42+
- name: Retrieve release distributions
43+
uses: actions/download-artifact@v3
44+
with:
45+
name: release-dists
46+
path: dist/
47+
48+
- name: Publish release distributions to PyPI
49+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)