From 6fbf854980f3782f36ee0e61574a25d306d59716 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Tue, 21 Jan 2025 15:20:08 +0100 Subject: [PATCH 1/2] Publish nightly builds in a release --- .github/workflows/build.yaml | 79 ++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ee61530df..1face4135 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -346,3 +346,82 @@ jobs: artifacts/mas-cli-aarch64-linux.tar.gz artifacts/mas-cli-x86_64-linux.tar.gz draft: true + + nightly: + name: Update the nightly release + runs-on: ubuntu-24.04 + needs: + - build-binaries + - build-image + if: github.ref == 'refs/heads/main' + + permissions: + contents: write + + steps: + - name: Download the artifacts from the previous job + uses: actions/download-artifact@v4 + with: + name: binaries + path: artifacts + + - name: Update nightly git tag + uses: actions/github-script@v7.0.1 + with: + script: | + const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/"); + const sha = process.env.GITHUB_SHA; + + const tag = await github.rest.git.updateRef({ + owner, + repo, + force: true + ref: 'refs/tags/nightly', + sha, + }); + console.log("Updated tag ref:", tag.data.url); + + - name: Update nightly release + uses: softprops/action-gh-release@v2 + with: + name: 'Nightly build' + tag_name: nightly + body: | + This is an automatically updated nightly release containing the latest builds from the main branch. + + **⚠️ Warning: These are development builds and may be unstable.** + + Last updated: ${{ github.event.head_commit.timestamp }} + Commit: ${{ github.sha }} + + ### Docker image + + Regular image: + + - Digest: + ``` + ${{ env.IMAGE }}@${{ fromJSON(needs.build-image.outputs.metadata).regular.digest }} + ``` + - Tags: + ``` + ${{ join(fromJSON(needs.build-image.outputs.metadata).regular.tags, ' + ') }} + ``` + + Debug variant: + + - Digest: + ``` + ${{ env.IMAGE }}@${{ fromJSON(needs.build-image.outputs.metadata).debug.digest }} + ``` + - Tags: + ``` + ${{ join(fromJSON(needs.build-image.outputs.metadata).debug.tags, ' + ') }} + ``` + + files: | + artifacts/mas-cli-aarch64-linux.tar.gz + artifacts/mas-cli-x86_64-linux.tar.gz + prerelease: true + make_latest: false From b41432ff8d6e0c302a5b0ee476488131806d1576 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Wed, 22 Jan 2025 15:53:10 +0100 Subject: [PATCH 2/2] s/nightly/unstable/ --- .github/workflows/build.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1face4135..69e21afc2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -347,8 +347,8 @@ jobs: artifacts/mas-cli-x86_64-linux.tar.gz draft: true - nightly: - name: Update the nightly release + unstable: + name: Update the unstable release runs-on: ubuntu-24.04 needs: - build-binaries @@ -365,7 +365,7 @@ jobs: name: binaries path: artifacts - - name: Update nightly git tag + - name: Update unstable git tag uses: actions/github-script@v7.0.1 with: script: | @@ -376,18 +376,18 @@ jobs: owner, repo, force: true - ref: 'refs/tags/nightly', + ref: 'refs/tags/unstable', sha, }); console.log("Updated tag ref:", tag.data.url); - - name: Update nightly release + - name: Update unstable release uses: softprops/action-gh-release@v2 with: - name: 'Nightly build' - tag_name: nightly + name: 'Unstable build' + tag_name: unstable body: | - This is an automatically updated nightly release containing the latest builds from the main branch. + This is an automatically updated unstable release containing the latest builds from the main branch. **⚠️ Warning: These are development builds and may be unstable.**