Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed183c2

Browse files
authored
Segment releasing into building and publishing
1 parent 9e6fe32 commit ed183c2

1 file changed

Lines changed: 32 additions & 17 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,40 @@ on:
1212
release:
1313
types: [published]
1414

15-
permissions:
16-
contents: read
17-
1815
jobs:
19-
deploy:
16+
release-build:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.x"
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install build
29+
- name: Build package
30+
run: python -m build
31+
- name: Upload dists
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: release-dists
35+
path: dist/
2036

37+
pypi-publish:
2138
runs-on: ubuntu-latest
39+
needs:
40+
- release-build
41+
permissions:
42+
id-token: write
2243

2344
steps:
24-
- uses: actions/checkout@v4
25-
- name: Set up Python
26-
uses: actions/setup-python@v5
27-
with:
28-
python-version: '3.x'
29-
- name: Install dependencies
30-
run: |
31-
python -m pip install --upgrade pip
32-
pip install build
33-
- name: Build package
34-
run: python -m build
35-
- name: Publish package
36-
uses: pypa/gh-action-pypi-publish@release/v1
45+
- name: Retrieve release distributions
46+
uses: actions/download-artifact@v4
47+
with:
48+
name: release-dists
49+
path: dist/
50+
- name: Publish release distributions to PyPI
51+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)