@@ -30,43 +30,32 @@ jobs:
30
30
with :
31
31
pull_token : ${{ secrets.PULL_TOKEN }}
32
32
33
- # If it's a nightly release, tag with the release time. If the tag is `main`,
34
- # we want to use the version from the `Cargo.toml` file.
35
33
- name : Compute release name and tag
36
34
id : release_info
37
35
run : |
38
- if [[ $IS_NIGHTLY ]]; then
39
- echo "tag_name=nightly-${GITHUB_SHA}" >> $GITHUB_OUTPUT
40
- echo "release_name=Nightly ($(date '+%Y-%m-%d'))" >> $GITHUB_OUTPUT
41
- elif [[ "${GITHUB_REF_NAME}" == "main" ]]; then
42
- # Parse the version from the `Cargo.toml` file.
43
- VERSION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "sp1-build") | .version')
44
-
45
- echo "tag_name=v${VERSION}" >> $GITHUB_OUTPUT
46
- echo "release_name=v${VERSION}" >> $GITHUB_OUTPUT
47
- else
48
- echo "tag_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
49
- echo "release_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
50
- fi
36
+ # Parse the version from the `Cargo.toml` file.
37
+ VERSION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "sp1-build") | .version')
38
+ echo "tag_name=v${VERSION}" >> $GITHUB_OUTPUT
39
+ echo "release_name=v${VERSION}" >> $GITHUB_OUTPUT
40
+
41
+ # - name: Build changelog
42
+ # uses: mikepenz/release-changelog-builder-action@v4
43
+ # id: build_changelog
44
+ # with:
45
+ # outputFile: ${{ steps.release_info.outputs.tag_name }}-changelog.md
46
+ # env:
47
+ # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51
48
52
- # Creates a tag for this release.
53
- - name : Create build-specific tag
54
- uses : actions/github-script@v7
49
+ - name : Create release
50
+ id : create_release
55
51
env :
56
- TAG_NAME : ${{ steps.release_info.outputs.tag_name }}
57
- with :
58
- script : |
59
- const createTag = require('./.github/scripts/create-tag.js')
60
- await createTag({ github, context }, process.env.TAG_NAME)
52
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
53
+ run : |
54
+ GH_DEBUG=api gh release create ${{ steps.release_info.outputs.tag_name }} --target main --generate-notes --latest=false
61
55
62
- - name : Build changelog
63
- id : build_changelog
64
- uses : mikepenz/release-changelog-builder-action@v4
65
- with :
66
- fromTag : ${{ env.IS_NIGHTLY && 'nightly' || '' }}
67
- toTag : ${{ steps.release_info.outputs.tag_name }}
68
- env :
69
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56
+ - name : Print GH version
57
+ run : |
58
+ gh version
70
59
71
60
release :
72
61
name : ${{ matrix.target }} (${{ matrix.runner }})
@@ -109,25 +98,17 @@ jobs:
109
98
steps :
110
99
- uses : actions/checkout@v4
111
100
112
- - name : Install rust toolchain
113
- id : rustc-toolchain
114
- uses : actions-rs/toolchain@v1
115
- with :
116
- toolchain : stable
117
- profile : minimal
118
- override : true
119
- targets : ${{ matrix.target }}
120
-
121
- - uses : Swatinem/rust-cache@v2
122
- with :
123
- key : ${{ matrix.target }}
124
- cache-on-failure : true
101
+ # Install rust and go
102
+ - name : Install rust
103
+ run : |
104
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
105
+ rustup install stable
125
106
126
107
- name : Install go
127
108
uses : actions/setup-go@v5
128
109
with :
129
110
go-version : " ^1.22.1"
130
-
111
+
131
112
- name : Check go installation
132
113
run : |
133
114
go version
@@ -199,7 +180,7 @@ jobs:
199
180
ARCH : ${{ matrix.arch }}
200
181
# NOTE: SP1UP Relies on the version name being the tag name,
201
182
# DO NOT CHANGE THIS WITHOUT UPDATING SP1UP TOO.
202
- VERSION_NAME : ${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }}
183
+ VERSION_NAME : ${{ needs.prepare.outputs.tag_name }}
203
184
shell : bash
204
185
run : |
205
186
if [ "$PLATFORM_NAME" == "linux" ]; then
@@ -217,33 +198,28 @@ jobs:
217
198
echo "file_name=cargo_prove_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" >> $GITHUB_OUTPUT
218
199
fi
219
200
220
- # Creates the release for this specific version
221
- # Note: If this CI job runs again on the same tag,
222
- # it will override the files there, but not change the commit to the current main.
223
- - name : Create release
224
- uses : softprops/action-gh-release@v2
225
- with :
226
- name : ${{ needs.prepare.outputs.release_name }}
227
- tag_name : ${{ needs.prepare.outputs.tag_name }}
228
- prerelease : ${{ env.IS_NIGHTLY }}
229
- body : ${{ needs.prepare.outputs.changelog }}
230
- files : |
231
- ${{ steps.artifacts.outputs.file_name }}
232
- ${{ steps.man.outputs.cargo_prove_man }}
233
-
234
- # If this is a nightly release, it also updates the release
235
- # tagged `nightly` for compatibility with `sp1up`
236
- - name : Update nightly release
237
- if : ${{ env.IS_NIGHTLY }}
238
- uses : softprops/action-gh-release@v2
239
- with :
240
- name : " Nightly"
241
- tag_name : " nightly"
242
- prerelease : true
243
- body : ${{ needs.prepare.outputs.changelog }}
244
- files : |
245
- ${{ steps.artifacts.outputs.file_name }}
246
- ${{ steps.man.outputs.cargo_prove_man }}
201
+ # Upload the artifacts to the release.
202
+ - name : Upload Release artifact
203
+ id : upload_release_artifact
204
+ env :
205
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
206
+ run : |
207
+ gh release upload ${{ needs.prepare.outputs.tag_name }} ${{ steps.artifacts.outputs.file_name }}
208
+
209
+ set-latest-release :
210
+ name : Set latest release
211
+ runs-on : ubuntu-latest
212
+ needs : [release, prepare]
213
+ if : success()
214
+ steps :
215
+ - uses : actions/checkout@v4
216
+
217
+ - name : Set latest release
218
+ env :
219
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
220
+ run : |
221
+ # Wait until all the binaries have been built to set the latest release.
222
+ gh release edit ${{ needs.prepare.outputs.tag_name }} --latest
247
223
248
224
toolchain-test :
249
225
name : " Test toolchain installation (${{ matrix.name }})"
@@ -271,8 +247,6 @@ jobs:
271
247
uses : " actions/checkout@v4"
272
248
273
249
- name : " Install SP1"
274
- env :
275
- SP1UP_VERSION : ${{ github.ref_name == 'main' && 'latest' || github.ref_name }}
276
250
run : |
277
251
cd sp1up
278
252
chmod +x sp1up
@@ -316,39 +290,16 @@ jobs:
316
290
AWS_SG_ID : " ${{ secrets.AWS_SG_ID }}"
317
291
GH_PAT : ${{ secrets.GH_PAT }}
318
292
319
- cleanup :
320
- name : Release cleanup
321
- runs-on : ubuntu-latest
322
- timeout-minutes : 30
323
- needs : release
324
- if : always()
325
- steps :
326
- - uses : actions/checkout@v4
327
-
328
- # Moves the `nightly` tag to `HEAD`
329
- - name : Move nightly tag
330
- if : ${{ env.IS_NIGHTLY }}
331
- uses : actions/github-script@v7
332
- with :
333
- script : |
334
- const moveTag = require('./.github/scripts/move-tag.js')
335
- await moveTag({ github, context }, 'nightly')
336
-
337
- - name : Delete old nightlies
338
- uses : actions/github-script@v7
339
- with :
340
- script : |
341
- const prunePrereleases = require('./.github/scripts/prune-prereleases.js')
342
- await prunePrereleases({github, context})
343
-
344
293
# If any of the jobs fail, this will create a high-priority issue to signal so.
345
294
issue :
346
295
name : Open an issue
347
296
runs-on : ubuntu-latest
348
- needs : [prepare, release, cleanup ]
297
+ needs : [prepare, release]
349
298
if : failure()
350
299
steps :
351
300
- uses : actions/checkout@v4
301
+
302
+ # todo remove this and use GH cli to create the issue
352
303
- uses : JasonEtco/create-an-issue@v2
353
304
env :
354
305
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -357,3 +308,18 @@ jobs:
357
308
with :
358
309
update_existing : true
359
310
filename : .github/RELEASE_FAILURE_ISSUE_TEMPLATE.md
311
+
312
+ # If any of the jobs fail, this will create a high-priority issue to signal so.
313
+ delete-failed-release :
314
+ name : Delete failed release
315
+ runs-on : ubuntu-latest
316
+ needs : [prepare, release]
317
+ if : failure()
318
+ steps :
319
+ - uses : actions/checkout@v4
320
+
321
+ - name : Delete failed release
322
+ env :
323
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
324
+ run : |
325
+ gh release delete ${{ needs.prepare.outputs.tag_name }} --cleanup-tag
0 commit comments