@@ -64,34 +64,94 @@ jobs:
64
64
needs : [build_wheels, build_sdist]
65
65
runs-on : ubuntu-latest
66
66
# upload to PyPI on every tag starting with 'v'
67
- if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') && contains(github.event.ref, '-rc.')
67
+ if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') && contains(github.event.ref, '-rc.')
68
+
69
+ environment :
70
+ name : testpypi
71
+ url : https://tesxt.pypi.org/p/clevercsv
72
+
73
+ permissions :
74
+ id-token : write
75
+
68
76
steps :
69
- - uses : actions/download-artifact@v2
77
+ - name : Download all the dists
78
+ uses : actions/download-artifact@v3
70
79
with :
71
- name : artifact
72
- path : dist
80
+ name : python-package-distributions
81
+ path : dist/
73
82
74
- - uses : pypa/gh-action-pypi-publish@master
83
+ - name : Publish distributions to TestPyPI
84
+ uses : pypa/gh-action-pypi-publish@release/v1
75
85
with :
76
- user : __token__
77
- password : ${{ secrets.TEST_PYPI_API_TOKEN }}
78
86
repository_url : https://test.pypi.org/legacy/
79
87
verbose : true
80
88
81
89
upload_pypi :
82
90
needs : [build_wheels, build_sdist]
83
91
runs-on : ubuntu-latest
84
92
# upload to PyPI on tags starting with 'v' that don't contain '-rc.'
85
- if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') && !contains(github.event.ref, '-rc.')
93
+ if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') && !contains(github.event.ref, '-rc.')
94
+
95
+ environment :
96
+ name : pypi
97
+ url : https://pypi.org/p/clevercsv
98
+
99
+ permissions :
100
+ id-token : write
101
+
86
102
steps :
87
- - uses : actions/download-artifact@v2
103
+ - name : Download all the dists
104
+ uses : actions/download-artifact@v3
88
105
with :
89
- name : artifact
90
- path : dist
106
+ name : python-package-distributions
107
+ path : dist/
91
108
92
- - uses : pypa/gh-action-pypi-publish@master
109
+ - name : Publish distributions to PyPI
110
+ uses : pypa/gh-action-pypi-publish@release/v1
93
111
with :
94
- user : __token__
95
- password : ${{ secrets.PYPI_API_TOKEN }}
96
112
verbose : true
97
113
114
+ github-release :
115
+ name : >-
116
+ Sign the Python 🐍 distribution 📦 with Sigstore
117
+ and upload the files to GitHub Release
118
+ needs :
119
+ - upload_pypi
120
+ runs-on : ubuntu-latest
121
+
122
+ permissions :
123
+ contents : write # IMPORTANT: mandatory for making GitHub Releases
124
+ id-token : write # IMPORTANT: mandatory for sigstore
125
+
126
+ steps :
127
+ - name : Download all the dists
128
+ uses : actions/download-artifact@v3
129
+ with :
130
+ name : python-package-distributions
131
+ path : dist/
132
+
133
+ - name : Sign the dists with Sigstore
134
+
135
+ with :
136
+ inputs : >-
137
+ ./dist/*.tar.gz
138
+ ./dist/*.whl
139
+
140
+ - name : Create GitHub Release
141
+ env :
142
+ GITHUB_TOKEN : ${{ github.token }}
143
+ run : >-
144
+ gh release create
145
+ '${{ github.ref_name }}'
146
+ --notes ""
147
+
148
+ - name : Upload artifact signatures to GitHub Release
149
+ env :
150
+ GITHUB_TOKEN : ${{ github.token }}
151
+ # Upload to GitHub Release using the `gh` CLI.
152
+ # `dist/` contains the built packages, and the
153
+ # sigstore-produced signatures and certificates.
154
+ run : >-
155
+ gh release upload
156
+ '${{ github.ref_name }}' dist/**
157
+ --repo '${{ github.repository }}'
0 commit comments