File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name: Build and Publish
33on :
44 push :
55 branches : [main]
6- tags : ' v*'
6+ tags : [ 'v*']
77 pull_request :
88 branches : [main]
99
@@ -37,10 +37,11 @@ jobs:
3737 with :
3838 name : python-package-distributions
3939 path : dist/
40+
4041 publish-to-pypi :
4142 name : >-
4243 Publish Python 🐍 distribution 📦 to PyPI
43- if : startsWith( github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
44+ if : github.ref_type == ' tag'
4445 needs :
4546 - build
4647 runs-on : ubuntu-latest
5859
5960 - name : Publish distribution 📦 to PyPI
6061 uses : pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
62+
63+ - name : Store the (now signed) distribution packages
64+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
65+ with :
66+ name : python-package-distributions
67+ path : dist/
68+ overwrite : true
69+
70+ add-release-artifacts :
71+ if : github.ref_type == 'tag'
72+ needs :
73+ - publish-to-pypi
74+ name : >-
75+ Sign the Python 🐍 distribution 📦 with Sigstore
76+ and upload them to GitHub Release
77+
78+ runs-on : ubuntu-latest
79+
80+ permissions :
81+ contents : write
82+ id-token : write
83+
84+ steps :
85+ - name : Download all the dists
86+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
87+ with :
88+ name : python-package-distributions
89+ path : dist/
90+
91+ - name : Upload release files and signatures
92+ uses : softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
93+ with :
94+ files : |
95+ ./dist/**
Original file line number Diff line number Diff line change 22set -euo pipefail
33
44changelog_file=" $( mktemp) "
5- cz bump --changelog-to-stdout --git-output-to-stderr > " $changelog_file "
5+ cz bump " ${CZ_BUMP_ARGS :- } " --changelog-to-stdout --git-output-to-stderr > " $changelog_file "
66
77git push origin main
88sleep 1
99git push --tags
1010sleep 1
11- gh release create " v$( cz version -p) " --verify-tag -t " Release v$( cz version -p) " -F " $changelog_file "
11+ gh release create " v$( cz version -p) " --verify-tag -t " Release v$( cz version -p) " -d - F " $changelog_file "
1212rm " $changelog_file "
You can’t perform that action at this time.
0 commit comments