@@ -115,7 +115,7 @@ jobs:
115115 done
116116
117117 - name : Upload the artifacts
118- uses : actions/upload-artifact@v4.5 .0
118+ uses : actions/upload-artifact@v4.6 .0
119119 with :
120120 name : binaries
121121 path : |
@@ -135,9 +135,6 @@ jobs:
135135 id-token : write
136136
137137 steps :
138- - name : Checkout the code
139- 140-
141138 - name : Docker meta
142139 id : meta
143140@@ -205,32 +202,28 @@ jobs:
205202 # For pull-requests, only read from the cache, do not try to push to the
206203 # cache or the image itself
207204 - name : Build
208- uses : docker/bake-action@v5.11 .0
205+ uses : docker/bake-action@v6.2 .0
209206 if : github.event_name == 'pull_request'
210207 with :
211208 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 }}
216213 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/
219214 base.cache-from=type=registry,ref=${{ env.BUILDCACHE }}:buildcache
220215
221216 - name : Build and push
222217 id : bake
223- uses : docker/bake-action@v5.11 .0
218+ uses : docker/bake-action@v6.2 .0
224219 if : github.event_name != 'pull_request'
225220 with :
226221 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 }}
231226 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/
234227 base.output=type=image,push=true
235228 base.cache-from=type=registry,ref=${{ env.BUILDCACHE }}:buildcache
236229 base.cache-to=type=registry,ref=${{ env.BUILDCACHE }}:buildcache,mode=max
@@ -251,11 +244,16 @@ jobs:
251244 github.event_name != 'pull_request'
252245 && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
253246
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+
254252 run : |-
255253 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 "
259257
260258 syn2mas :
261259 name : Release syn2mas on NPM
@@ -303,6 +301,7 @@ jobs:
303301 - name : Prepare a release
304302 uses : softprops/action-gh-release@v2
305303 with :
304+ generate_release_notes : true
306305 body : |
307306 ### Docker image
308307
@@ -346,3 +345,82 @@ jobs:
346345 artifacts/mas-cli-aarch64-linux.tar.gz
347346 artifacts/mas-cli-x86_64-linux.tar.gz
348347 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