Skip to content

Commit 6fbf854

Browse files
committed
Publish nightly builds in a release
1 parent 0514487 commit 6fbf854

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

0 commit comments

Comments
 (0)