8000 Align release workflow with latest recommendations · pypa/pip@e2c3631 · GitHub
[go: up one dir, main page]

Skip to content

Commit e2c3631

Browse files
committed
Align release workflow with latest recommendations
1 parent fa37194 commit e2c3631

File tree

1 file changed

+33
-11
lines changed

1 file changed

+33
-11
lines changed

.github/workflows/release.yml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,46 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI
2+
13
on:
24
push:
35
tags:
46
- "*"
57

6-
name: Release
7-
88
jobs:
9-
pypi:
10-
name: Upload release to PyPI
9+
build:
10+
name: Build distribution 📦
1111
runs-on: ubuntu-latest
12-
environment: release
13-
permissions:
14-
# Used to authenticate to PyPI via OIDC.
15-
id-token: write
12+
1613
steps:
1714
- uses: actions/checkout@v4
18-
- uses: actions/setup-python@v5
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
1917
with:
2018
python-version: "3.x"
21-
- name: Build sdist and wheel
19+
- name: Build a binary wheel and a source tarball
2220
run: pipx run build
23-
- name: Publish to PyPI
21+
- name: Store the distribution packages
22+
uses: actions/upload-artifact@v4
23+
with:
24+
name: python-package-distributions
25+
path: dist/
26+
27+
publish-to-pypi:
28+
name: >-
29+
Publish Python 🐍 distribution 📦 to PyPI
30+
needs:
31+
- build
32+
runs-on: ubuntu-latest
33+
environment:
34+
name: pypi
35+
url: https://pypi.org/p/pip/${{ github.ref_name }}
36+
permissions:
37+
id-token: write # IMPORTANT: mandatory for trusted publishing
38+
39+
steps:
40+
- name: Download all the dists
41+
uses: actions/download-artifact@v4
42+
with:
43+
name: python-package-distributions
44+
path: dist/
45+
- name: Publish distribution 📦 to PyPI
2446
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)
0