11name : Build and Release
22
33on :
4- push :
5- tags : ["*"]
6- pull_request :
74 workflow_dispatch :
5+ inputs :
6+ version :
7+ description : " Version to release (e.g., 0.1.0)"
8+ required : true
9+ type : string
810
911permissions :
10- contents : read
11- id-token : write # For PyPI OIDC publishing
12- attestations : write # For artifact attestation
12+ contents : write # Changed to write for tagging
13+ id-token : write
14+ attestations : write
1315
1416jobs :
1517 build-wheels-linux :
1618 runs-on : ${{ matrix.platform.runner }}
1719 steps :
1820 - uses : actions/checkout@v4
19- - name : Wait for tests to succeed
20- uses : lewagon/wait-on-check-action@v1.4.1
21- with :
22- ref : ${{ github.ref }}
23- check-name : test
24- repo-token : ${{ secrets.GITHUB_TOKEN }}
25- wait-interval : 10
2621 - uses : actions/setup-python@v5
2722 with :
2823 python-version : 3.x
4136 working-directory : kiru-py
4237 target : ${{ matrix.platform.target }}
4338 args : --release --out dist --find-interpreter
44- sccache : ${{ !startsWith(github.ref, 'refs/tags/') }}
39+ sccache : " true "
4540 manylinux : auto
4641 - name : Upload wheels
4742 uses : actions/upload-artifact@v4
6863 runs-on : ${{ matrix.platform.runner }}
6964 steps :
7065 - uses : actions/checkout@v4
71- - name : Wait for tests to succeed
72- uses : lewagon/wait-on-check-action@v1.4.1
73- with :
74- ref : ${{ github.ref }}
75- check-name : test
76- repo-token : ${{ secrets.GITHUB_TOKEN }}
77- wait-interval : 10
7866 - uses : actions/setup-python@v5
7967 with :
8068 python-version : 3.x
9381 working-directory : kiru-py
9482 target : ${{ matrix.platform.target }}
9583 args : --release --out dist --find-interpreter
96- sccache : ${{ !startsWith(github.ref, 'refs/tags/') }}
84+ sccache : " true "
9785 manylinux : musllinux_1_2
9886 - name : Upload wheels
9987 uses : actions/upload-artifact@v4
@@ -116,13 +104,6 @@ jobs:
116104 runs-on : ${{ matrix.platform.runner }}
117105 steps :
118106 - uses : actions/checkout@v4
119- - name : Wait for tests to succeed
120- uses : lewagon/wait-on-check-action@v1.4.1
121- with :
122- ref : ${{ github.ref }}
123- check-name : test
124- repo-token : ${{ secrets.GITHUB_TOKEN }}
125- wait-interval : 10
126107 - uses : actions/setup-python@v5
127108 with :
128109 python-version : 3.x
@@ -142,7 +123,7 @@ jobs:
142123 working-directory : kiru-py
143124 target : ${{ matrix.platform.target }}
144125 args : --release --out dist --find-interpreter
145- sccache : ${{ !startsWith(github.ref, 'refs/tags/') }}
126+ sccache : " true "
146127 - name : Upload wheels
147128 uses : actions/upload-artifact@v4
148129 with :
@@ -160,13 +141,6 @@ jobs:
160141 runs-on : ${{ matrix.platform.runner }}
161142 steps :
162143 - uses : actions/checkout@v4
163- - name : Wait for tests to succeed
164- uses : lewagon/wait-on-check-action@v1.4.1
165- with :
166- ref : ${{ github.ref }}
167- check-name : test
168- repo-token : ${{ secrets.GITHUB_TOKEN }}
169- wait-interval : 10
170144 - uses : actions/setup-python@v5
171145 with :
172146 python-version : 3.x
@@ -185,7 +159,7 @@ jobs:
185159 working-directory : kiru-py
186160 target : ${{ matrix.platform.target }}
187161 args : --release --out dist --find-interpreter
188- sccache : ${{ !startsWith(github.ref, 'refs/tags/') }}
162+ sccache : " true "
189163 - name : Upload wheels
190164 uses : actions/upload-artifact@v4
191165 with :
@@ -203,13 +177,6 @@ jobs:
203177 runs-on : ubuntu-latest
204178 steps :
205179 - uses : actions/checkout@v4
206- - name : Wait for tests to succeed
207- uses : lewagon/wait-on-check-action@v1.4.1
208- with :
209- ref : ${{ github.ref }}
210- check-name : test
211- repo-token : ${{ secrets.GITHUB_TOKEN }}
212- wait-interval : 10
213180 - uses : actions/setup-python@v5
214181 with :
215182 python-version : 3.x
@@ -229,13 +196,6 @@ jobs:
229196 runs-on : ubuntu-latest
230197 steps :
231198 - uses : actions/checkout@v4
232- - name : Wait for tests to succeed
233- uses : lewagon/wait-on-check-action@v1.4.1
234- with :
235- ref : ${{ github.ref }}
236- check-name : test
237- repo-token : ${{ secrets.GITHUB_TOKEN }}
238- wait-interval : 10
239199 - name : Install Rust
240200 uses : dtolnay/rust-toolchain@stable
241201 - name : Package kiru-core
@@ -248,7 +208,6 @@ jobs:
248208
249209 release :
250210 runs-on : ubuntu-latest
251- if : startsWith(github.ref, 'refs/tags/')
252211 needs :
253212 [
254213 build-wheels-linux,
@@ -264,18 +223,13 @@ jobs:
264223 attestations : write
265224 steps :
266225 - uses : actions/checkout@v4
267- - name : Wait for tests to succeed
268- uses : lewagon/wait-on-check-action@v1.4.1
269226 with :
270- ref : ${{ github.ref }}
271- check-name : test
272- repo-token : ${{ secrets.GITHUB_TOKEN }}
273- wait-interval : 10
227+ fetch-depth : 0 # Need full history for tagging
274228 - uses : actions/download-artifact@v4
275229 - name : Generate artifact attestation
276230 uses : actions/attest-build-provenance@v2
277231 with :
278- subject-path : " wheels-*/*"
232+ subject-path : " wheels-*/*,crate-kiru-core/* "
279233 - name : Publish kiru-core to crates.io
280234 env :
281235 CARGO_REGISTRY_TOKEN : ${{ secrets.CRATES_IO_TOKEN }}
@@ -291,6 +245,14 @@ jobs:
291245 - name : Create GitHub Release
292246 uses : softprops/action-gh-release@v2
293247 with :
248+ tag_name : v${{ inputs.version }}
249+ name : Release v${{ inputs.version }}
294250 files : |
295251 wheels-*/*
296252 crate-kiru-core/*
253+ - name : Create and push tag
254+ run : |
255+ git config user.name "github-actions[bot]"
256+ git config user.email "github-actions[bot]@users.noreply.github.com"
257+ git tag v${{ inputs.version }} -m "Release v${{ inputs.version }}"
258+ git push origin v${{ inputs.version }}
0 commit comments