Skip to content

Commit 39303b9

Browse files
authored
Upgrade release workflow (#65)
1 parent 1a33aff commit 39303b9

File tree

1 file changed

+29
-72
lines changed

1 file changed

+29
-72
lines changed

.github/workflows/release.yml

+29-72
Original file line numberDiff line numberDiff line change
@@ -11,86 +11,43 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v4
15-
- name: Set up Python
16-
uses: actions/setup-python@v4
17-
with:
18-
python-version: "3.x"
19-
- name: Install pypa/build
20-
run: >-
21-
python3 -m
22-
pip install
23-
build
24-
--user
25-
- name: Build a binary wheel and a source tarball
26-
run: python3 -m build
27-
- name: Store the distribution packages
28-
uses: actions/upload-artifact@v3
29-
with:
30-
name: python-package-distributions
31-
path: dist/
14+
- uses: actions/checkout@v4
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.x"
19+
- name: Install pypa/build
20+
run: >-
21+
python3 -m
22+
pip install
23+
build
24+
--user
25+
- name: Build a binary wheel and a source tarball
26+
run: python3 -m build
27+
- name: Store the distribution packages
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: python-package-distributions
31+
path: dist/
3232

3333
publish-to-pypi:
3434
name: >-
3535
Publish Python 🐍 distribution 📦 to PyPI
36-
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
36+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
3737
needs:
38-
- build
38+
- build
3939
runs-on: ubuntu-latest
4040
environment:
4141
name: pypi
42-
url: https://pypi.org/p/wb-template # Replace with your PyPI project name
42+
url: https://pypi.org/p/wb-template # Replace <package-name> with your PyPI project name
4343
permissions:
44-
id-token: write # IMPORTANT: mandatory for trusted publishing
44+
id-token: write # IMPORTANT: mandatory for trusted publishing
4545

4646
steps:
47-
- name: Download all the dists
48-
uses: actions/download-artifact@v3
49-
with:
50-
name: python-package-distributions
51-
path: dist/
52-
- name: Publish distribution 📦 to PyPI
53-
uses: pypa/gh-action-pypi-publish@release/v1
54-
55-
github-release:
56-
name: >-
57-
Sign the Python 🐍 distribution 📦 with Sigstore
58-
and upload them to GitHub Release
59-
needs:
60-
- publish-to-pypi
61-
runs-on: ubuntu-latest
62-
63-
permissions:
64-
contents: write # IMPORTANT: mandatory for making GitHub Releases
65-
id-token: write # IMPORTANT: mandatory for sigstore
66-
67-
steps:
68-
- name: Download all the dists
69-
uses: actions/download-artifact@v3
70-
with:
71-
name: python-package-distributions
72-
path: dist/
73-
- name: Sign the dists with Sigstore
74-
uses: sigstore/gh-action-sigstore-python@v1.2.3
75-
with:
76-
inputs: >-
77-
./dist/*.tar.gz
78-
./dist/*.whl
79-
- name: Create GitHub Release
80-
env:
81-
GITHUB_TOKEN: ${{ github.token }}
82-
run: >-
83-
gh release create
84-
'${{ github.ref_name }}'
85-
--repo '${{ github.repository }}'
86-
--notes ""
87-
- name: Upload artifact signatures to GitHub Release
88-
env:
89-
GITHUB_TOKEN: ${{ github.token }}
90-
# Upload to GitHub Release using the `gh` CLI.
91-
# `dist/` contains the built packages, and the
92-
# sigstore-produced signatures and certificates.
93-
run: >-
94-
gh release upload
95-
'${{ github.ref_name }}' dist/**
96-
--repo '${{ github.repository }}'
47+
- name: Download all the dists
48+
uses: actions/download-artifact@v4
49+
with:
50+
name: python-package-distributions
51+
path: dist/
52+
- name: Publish distribution 📦 to PyPI
53+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)