Skip to content

Commit 773772c

Browse files
committed
Publish nightly builds in a release
1 parent 08afa00 commit 773772c

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

.github/workflows/build.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,3 +344,82 @@ jobs:
344344
artifacts/mas-cli-aarch64-linux.tar.gz
345345
artifacts/mas-cli-x86_64-linux.tar.gz
346346
draft: true
347+
348+
nightly:
349+
name: Update the nightly release
350+
runs-on: ubuntu-24.04
351+
needs:
352+
- build-binaries
353+
- build-image
354+
if: github.ref == 'refs/heads/main'
355+
356+
permissions:
357+
contents: write
358+
359+
steps:
360+
- name: Download the artifacts from the previous job
361+
uses: actions/download-artifact@v4
362+
with:
363+
name: binaries
364+
path: artifacts
365+
366+
- name: Update nightly git tag
367+
uses: actions/[email protected]
368+
with:
369+
script: |
370+
const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
371+
const sha = process.env.GITHUB_SHA;
372+
373+
const tag = await github.rest.git.updateRef({
374+
owner,
375+
repo,
376+
force: true
377+
ref: 'refs/tags/nightly',
378+
sha,
379+
});
380+
console.log("Updated tag ref:", tag.data.url);
381+
382+
- name: Update nightly release
383+
uses: softprops/action-gh-release@v2
384+
with:
385+
name: 'Nightly build'
386+
tag_name: nightly
387+
body: |
388+
This is an automatically updated nightly release containing the latest builds from the main branch.
389+
390+
**⚠️ Warning: These are development builds and may be unstable.**
391+
392+
Last updated: ${{ github.event.head_commit.timestamp }}
393+
Commit: ${{ github.sha }}
394+
395+
### Docker image
396+
397+
Regular image:
398+
399+
- Digest:
400+
```
401+
${{ env.IMAGE }}@${{ fromJSON(needs.build-image.outputs.metadata).regular.digest }}
402+
```
403+
- Tags:
404+
```
405+
${{ join(fromJSON(needs.build-image.outputs.metadata).regular.tags, '
406+
') }}
407+
```
408+
409+
Debug variant:
410+
411+
- Digest:
412+
```
413+
${{ env.IMAGE }}@${{ fromJSON(needs.build-image.outputs.metadata).debug.digest }}
414+
```
415+
- Tags:
416+
```
417+
${{ join(fromJSON(needs.build-image.outputs.metadata).debug.tags, '
418+
') }}
419+
```
420+
421+
files: |
422+
artifacts/mas-cli-aarch64-linux.tar.gz
423+
artifacts/mas-cli-x86_64-linux.tar.gz
424+
prerelease: true
425+
make_latest: false

0 commit comments

Comments
 (0)