Skip to content

Commit 988fe00

Browse files
committed
Simplify release process
1 parent 1c9fdfb commit 988fe00

File tree

1 file changed

+9
-71
lines changed

1 file changed

+9
-71
lines changed

.github/workflows/publish_to_pypi.yml

Lines changed: 9 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ on:
44
push:
55
branches:
66
- main
7-
87
jobs:
9-
build:
10-
name: Build distribution
8+
publish-to-pypi:
9+
name: >-
10+
Publish to PyPI
11+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
1112
runs-on: ubuntu-latest
12-
13+
environment:
14+
name: pypi
15+
url: https://pypi.org/p/pyoframe
16+
permissions:
17+
id-token: write # IMPORTANT: mandatory for trusted publishing
1318
steps:
1419
- uses: actions/checkout@v4
1520
- name: Set up Python
@@ -24,72 +29,5 @@ jobs:
2429
--user
2530
- name: Build a binary wheel and a source tarball
2631
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/
32-
33-
publish-to-pypi:
34-
name: >-
35-
Publish to PyPI
36-
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
37-
needs:
38-
- build
39-
runs-on: ubuntu-latest
40-
environment:
41-
name: pypi
42-
url: https://pypi.org/p/pyoframe # Replace <package-name> with your PyPI project name
43-
permissions:
44-
id-token: write # IMPORTANT: mandatory for trusted publishing
45-
46-
steps:
47-
- name: Download all the dists
48-
uses: actions/download-artifact@v3
49-
with:
50-
name: python-package-distributions
51-
path: dist/
5232
- name: Publish distribution 📦 to PyPI
5333
uses: pypa/gh-action-pypi-publish@release/v1
54-
55-
github-release:
56-
name: >-
57-
Publish to GitHub Releases
58-
needs:
59-
- publish-to-pypi
60-
runs-on: ubuntu-latest
61-
62-
permissions:
63-
contents: write # IMPORTANT: mandatory for making GitHub Releases
64-
id-token: write # IMPORTANT: mandatory for sigstore
65-
66-
steps:
67-
- name: Download all the dists
68-
uses: actions/download-artifact@v3
69-
with:
70-
name: python-package-distributions
71-
path: dist/
72-
- name: Sign the dists with Sigstore
73-
uses: sigstore/[email protected]
74-
with:
75-
inputs: >-
76-
./dist/*.tar.gz
77-
./dist/*.whl
78-
- name: Create GitHub Release
79-
env:
80-
GITHUB_TOKEN: ${{ github.token }}
81-
run: >-
82-
gh release create
83-
'${{ github.ref_name }}'
84-
--repo '${{ github.repository }}'
85-
--notes ""
86-
- name: Upload artifact signatures to GitHub Release
87-
env:
88-
GITHUB_TOKEN: ${{ github.token }}
89-
# Upload to GitHub Release using the `gh` CLI.
90-
# `dist/` contains the built packages, and the
91-
# sigstore-produced signatures and certificates.
92-
run: >-
93-
gh release upload
94-
'${{ github.ref_name }}' dist/**
95-
--repo '${{ github.repository }}'

0 commit comments

Comments
 (0)