@@ -115,7 +115,7 @@ jobs:
115
115
done
116
116
117
117
- name : Upload the artifacts
118
- uses : actions/upload-artifact@v4.5 .0
118
+ uses : actions/upload-artifact@v4.6 .0
119
119
with :
120
120
name : binaries
121
121
path : |
@@ -135,9 +135,6 @@ jobs:
135
135
id-token : write
136
136
137
137
steps :
138
- - name : Checkout the code
139
-
140
-
141
138
- name : Docker meta
142
139
id : meta
143
140
@@ -205,32 +202,28 @@ jobs:
205
202
# For pull-requests, only read from the cache, do not try to push to the
206
203
# cache or the image itself
207
204
- name : Build
208
- uses : docker/bake-action@v5.11 .0
205
+ uses : docker/bake-action@v6.2 .0
209
206
if : github.event_name == 'pull_request'
210
207
with :
211
208
files : |
212
- docker-bake.hcl
213
- ${{ steps.meta.outputs.bake-file }}
214
- ${{ steps.meta-debug.outputs.bake-file }}
215
- ${{ steps.meta-syn2mas.outputs.bake-file }}
209
+ ./ docker-bake.hcl
210
+ cwd:// ${{ steps.meta.outputs.bake-file }}
211
+ cwd:// ${{ steps.meta-debug.outputs.bake-file }}
212
+ cwd:// ${{ steps.meta-syn2mas.outputs.bake-file }}
216
213
set : |
217
- base.context=https://github.com/${{ github.repository }}.git#${{ github.ref }}
218
- syn2mas.context=https://github.com/${{ github.repository }}.git#${{ github.ref }}:tools/syn2mas/
219
214
base.cache-from=type=registry,ref=${{ env.BUILDCACHE }}:buildcache
220
215
221
216
- name : Build and push
222
217
id : bake
223
- uses : docker/bake-action@v5.11 .0
218
+ uses : docker/bake-action@v6.2 .0
224
219
if : github.event_name != 'pull_request'
225
220
with :
226
221
files : |
227
- docker-bake.hcl
228
- ${{ steps.meta.outputs.bake-file }}
229
- ${{ steps.meta-debug.outputs.bake-file }}
230
- ${{ steps.meta-syn2mas.outputs.bake-file }}
222
+ ./ docker-bake.hcl
223
+ cwd:// ${{ steps.meta.outputs.bake-file }}
224
+ cwd:// ${{ steps.meta-debug.outputs.bake-file }}
225
+ cwd:// ${{ steps.meta-syn2mas.outputs.bake-file }}
231
226
set : |
232
- base.context=https://github.com/${{ github.repository }}.git#${{ github.ref }}
233
- syn2mas.context=https://github.com/${{ github.repository }}.git#${{ github.ref }}:tools/syn2mas/
234
227
base.output=type=image,push=true
235
228
base.cache-from=type=registry,ref=${{ env.BUILDCACHE }}:buildcache
236
229
base.cache-to=type=registry,ref=${{ env.BUILDCACHE }}:buildcache,mode=max
@@ -251,11 +244,16 @@ jobs:
251
244
github.event_name != 'pull_request'
252
245
&& (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
253
246
247
+ env :
248
+ REGULAR_DIGEST : ${{ steps.output.outputs.metadata && fromJSON(steps.output.outputs.metadata).regular.digest }}
249
+ DEBUG_DIGEST : ${{ steps.output.outputs.metadata && fromJSON(steps.output.outputs.metadata).debug.digest }}
250
+ SYN2MAS_DIGEST : ${{ steps.output.outputs.metadata && fromJSON(steps.output.outputs.metadata).syn2mas.digest }}
251
+
254
252
run : |-
255
253
cosign sign --yes \
256
- "${{ env. IMAGE }}@${{ fromJSON(steps.output.outputs.metadata).regular.digest }} " \
257
- "${{ env. IMAGE }}@${{ fromJSON(steps.output.outputs.metadata).debug.digest }} " \
258
- "${{ env. IMAGE_SYN2MAS }}@${{ fromJSON(steps.output.outputs.metadata).syn2mas.digest }} "
254
+ "$IMAGE@$REGULAR_DIGEST " \
255
+ "$IMAGE@$DEBUG_DIGEST " \
256
+ "$IMAGE_SYN2MAS@$SYN2MAS_DIGEST "
259
257
260
258
syn2mas :
261
259
name : Release syn2mas on NPM
@@ -303,6 +301,7 @@ jobs:
303
301
- name : Prepare a release
304
302
uses : softprops/action-gh-release@v2
305
303
with :
304
+ generate_release_notes : true
306
305
body : |
307
306
### Docker image
308
307
@@ -346,3 +345,82 @@ jobs:
346
345
artifacts/mas-cli-aarch64-linux.tar.gz
347
346
artifacts/mas-cli-x86_64-linux.tar.gz
348
347
draft : true
348
+
349
+ unstable :
350
+ name : Update the unstable release
351
+ runs-on : ubuntu-24.04
352
+ needs :
353
+ - build-binaries
354
+ - build-image
355
+ if : github.ref == 'refs/heads/main'
356
+
357
+ permissions :
358
+ contents : write
359
+
360
+ steps :
361
+ - name : Download the artifacts from the previous job
362
+ uses : actions/download-artifact@v4
363
+ with :
364
+ name : binaries
365
+ path : artifacts
366
+
367
+ - name : Update unstable git tag
368
+
369
+ with :
370
+ script : |
371
+ const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
372
+ const sha = process.env.GITHUB_SHA;
373
+
374
+ const tag = await github.rest.git.updateRef({
375
+ owner,
376
+ repo,
377
+ force: true,
378
+ ref: 'tags/unstable',
379
+ sha,
380
+ });
381
+ console.log("Updated tag ref:", tag.data.url);
382
+
383
+ - name : Update unstable release
384
+ uses : softprops/action-gh-release@v2
385
+ with :
386
+ name : ' Unstable build'
387
+ tag_name : unstable
388
+ body : |
389
+ This is an automatically updated unstable release containing the latest builds from the main branch.
390
+
391
+ **⚠️ Warning: These are development builds and may be unstable.**
392
+
393
+ Last updated: ${{ github.event.head_commit.timestamp }}
394
+ Commit: ${{ github.sha }}
395
+
396
+ ### Docker image
397
+
398
+ Regular image:
399
+
400
+ - Digest:
401
+ ```
402
+ ${{ env.IMAGE }}@${{ fromJSON(needs.build-image.outputs.metadata).regular.digest }}
403
+ ```
404
+ - Tags:
405
+ ```
406
+ ${{ join(fromJSON(needs.build-image.outputs.metadata).regular.tags, '
407
+ ') }}
408
+ ```
409
+
410
+ Debug variant:
411
+
412
+ - Digest:
413
+ ```
414
+ ${{ env.IMAGE }}@${{ fromJSON(needs.build-image.outputs.metadata).debug.digest }}
415
+ ```
416
+ - Tags:
417
+ ```
418
+ ${{ join(fromJSON(needs.build-image.outputs.metadata).debug.tags, '
419
+ ') }}
420
+ ```
421
+
422
+ files : |
423
+ artifacts/mas-cli-aarch64-linux.tar.gz
424
+ artifacts/mas-cli-x86_64-linux.tar.gz
425
+ prerelease : true
426
+ make_latest : false
0 commit comments