Skip to content

Commit df045a9

Browse files
committed
Update publish action
1 parent 53aaea0 commit df045a9

File tree

1 file changed

+36
-17
lines changed

1 file changed

+36
-17
lines changed

.github/workflows/python-publish.yml

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,41 @@ on:
1010

1111

1212
jobs:
13-
deploy:
13+
release-build:
1414
runs-on: ubuntu-latest
15+
1516
steps:
16-
- uses: actions/checkout@v3
17-
- name: Set up Python
18-
uses: actions/setup-python@v4
19-
with:
20-
python-version: '3.10'
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine build hatch
25-
- name: Build and publish
26-
env:
27-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29-
run: |
30-
python -m build
31-
twine upload dist/*
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.10"
22+
23+
- name: build release distributions
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install setuptools wheel twine build hatch
27+
python -m build
28+
29+
- name: upload dists
30+
uses: actions/upload-artifact@v3
31+
with:
32+
name: release-dists
33+
path: dist/
34+
35+
pypi-publish:
36+
runs-on: ubuntu-latest
37+
needs:
38+
- release-build
39+
permissions:
40+
id-token: write
41+
42+
steps:
43+
- name: Retrieve release distributions
44+
uses: actions/download-artifact@v3
45+
with:
46+
name: release-dists
47+
path: dist/
48+
49+
- name: Publish release distributions to PyPI
50+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)