From 19b92cc9f343b7bb94f9bddc2fd47acba50b0cc2 Mon Sep 17 00:00:00 2001 From: Hook25 Date: Thu, 26 Oct 2023 14:40:35 +0200 Subject: [PATCH] Added envvar for build id and merged frontend buids Minor: Spaces, nomenclature, moved comments Minor: bumped retries for build and upload --- .../checkbox-core-snap-daily-builds.yml | 25 ++++++++++--------- .../workflows/checkbox-snap-daily-builds.yml | 24 +++++++++--------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.github/workflows/checkbox-core-snap-daily-builds.yml b/.github/workflows/checkbox-core-snap-daily-builds.yml index ca546324a6..1de60ed057 100644 --- a/.github/workflows/checkbox-core-snap-daily-builds.yml +++ b/.github/workflows/checkbox-core-snap-daily-builds.yml @@ -30,14 +30,18 @@ jobs: strategy: matrix: releases: [16, 18, 20, 22] - arch: [amd64,arm64,armhf] + arch: [amd64, arm64, armhf] needs: check_history if: ${{ needs.check_history.outputs.should_run != 'false' }} || github.event_name == 'workflow_dispatch' runs-on: [self-hosted, linux, large] env: SERIES: series${{ matrix.releases }} SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT7_CREDS }} - name: Runtime${{ matrix.releases }}-${{ matrix.arch }} + # snapcraft remote-build will create a repository with the name decided by the --build-id arg + # it is useful to have this URL to debug builds, note that it will not change if the same workflow is re-run + # as the run_id will not change + SNAPCRAFT_BUILDER_ID: checkbox${{ matrix.releases }}-${{ matrix.arch }}-${{ github.run_id }} + name: Runtime (Core) ${{ matrix.releases }}-${{ matrix.arch }} steps: - uses: actions/checkout@v3 with: @@ -55,20 +59,17 @@ jobs: git config --global user.name "Certification bot" - name: Print Launchpad build repository run: | - # snapcraft remote-build will create a repository with the name decided by the --build-id arg - # it is useful to have this URL to debug builds, note that it will not change if the same workflow is re-run - # as the run_id will not change - echo "Building at: https://git.launchpad.net/~ce-certification-qa/+git/checkbox${{ matrix.releases }}-${{ matrix.arch }}-${{ github.run_id }}" + echo "Building at: https://git.launchpad.net/~ce-certification-qa/+git/$SNAPCRAFT_BUILDER_ID" - uses: Wandalen/wretry.action@a163f62ae554a8f3cbe27b23db15b60c0ae2e93c # v1.3.0 - name: Build Snap + name: Build the snap with: action: Hook25/action-build@707dce252c4f367b6c1afe61ed577f7413cf7912 attempt_delay: 600000 # 10min - attempt_limit: 3 + attempt_limit: 5 with: | path: checkbox-core-snap/series${{ matrix.releases }} snapcraft-channel: 7.x/stable - snapcraft-args: remote-build --build-on ${{ matrix.arch }} --launchpad-accept-public-upload --build-id checkbox${{ matrix.releases }}-${{ matrix.arch }}-${{ github.run_id }} + snapcraft-args: remote-build --build-for ${{ matrix.arch }} --launchpad-accept-public-upload --build-id $SNAPCRAFT_BUILDER_ID - uses: actions/upload-artifact@v3 name: Upload logs on failure if: failure() @@ -79,15 +80,15 @@ jobs: /home/runner/.local/state/snapcraft/log/ checkbox-core-snap/series${{ matrix.releases }}/checkbox*.txt - uses: actions/upload-artifact@v3 - name: Upload snaps as artifact + name: Upload the snap as artifact with: name: series${{ matrix.releases }} path: checkbox-core-snap/series${{ matrix.releases }}/*.snap - uses: Wandalen/wretry.action@a163f62ae554a8f3cbe27b23db15b60c0ae2e93c # v1.3.0 - name: Upload checkbox core snaps to the store + name: Upload the snap to the store with: attempt_delay: 600000 # 10min - attempt_limit: 3 + attempt_limit: 10 command: | for snap in checkbox-core-snap/series${{ matrix.releases }}/*.snap ; \ do \ diff --git a/.github/workflows/checkbox-snap-daily-builds.yml b/.github/workflows/checkbox-snap-daily-builds.yml index 820ffab0ae..402fb90ab9 100644 --- a/.github/workflows/checkbox-snap-daily-builds.yml +++ b/.github/workflows/checkbox-snap-daily-builds.yml @@ -31,14 +31,17 @@ jobs: matrix: type: [classic, uc] releases: [16, 18, 20, 22] - arch: [amd64, arm64, armhf] needs: check_history if: ${{ needs.check_history.outputs.should_run != 'false' }} || github.event_name == 'workflow_dispatch' runs-on: [self-hosted, linux, large] env: SERIES: series_${{ matrix.type }}${{ matrix.releases }} SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT7_CREDS }} - name: Frontend ${{ matrix.type }}${{ matrix.releases }}-${{ matrix.arch }} + # snapcraft remote-build will create a repository with the name decided by the --build-id arg + # it is useful to have this URL to debug builds, note that it will not change if the same workflow is re-run + # as the run_id will not change + SNAPCRAFT_BUILDER_ID: checkbox-${{ matrix.type }}${{ matrix.releases }}-${{ github.run_id }} + name: Frontend ${{ matrix.type }}${{ matrix.releases }} steps: - uses: actions/checkout@v3 with: @@ -56,20 +59,17 @@ jobs: git config --global user.name "Certification bot" - name: Print Launchpad build repository run: | - # snapcraft remote-build will create a repository with the name decided by the --build-id arg - # it is useful to have this URL to debug builds, note that it will not change if the same workflow is re-run - # as the run_id will not change - echo "Building at: https://git.launchpad.net/~ce-certification-qa/+git/checkbox-${{ matrix.type }}${{ matrix.releases }}-${{ matrix.arch }}-${{ github.run_id }}" + echo "Building at: https://git.launchpad.net/~ce-certification-qa/+git/$SNAPCRAFT_BUILDER_ID" - uses: Wandalen/wretry.action@a163f62ae554a8f3cbe27b23db15b60c0ae2e93c # v1.3.0 - name: Build Snap + name: Building the snaps with: action: Hook25/action-build@707dce252c4f367b6c1afe61ed577f7413cf7912 attempt_delay: 600000 # 10min - attempt_limit: 3 + attempt_limit: 5 with: | path: checkbox-snap/series_${{ matrix.type }}${{ matrix.releases }} snapcraft-channel: 7.x/stable - snapcraft-args: remote-build --build-on ${{ matrix.arch }} --launchpad-accept-public-upload --build-id checkbox-${{ matrix.type }}${{ matrix.releases }}-${{ matrix.arch }}-${{ github.run_id }} + snapcraft-args: remote-build --build-for amd64,arm64,armhf --launchpad-accept-public-upload --build-id $SNAPCRAFT_BUILDER_ID - uses: actions/upload-artifact@v3 name: Upload logs on failure if: failure() @@ -80,15 +80,15 @@ jobs: /home/runner/.local/state/snapcraft/log/ checkbox-snap/series_${{ matrix.type }}${{ matrix.releases }}/checkbox*.txt - uses: actions/upload-artifact@v3 - name: Upload snaps as artifact + name: Upload the snaps as artefacts with: name: series_${{ matrix.type }}${{ matrix.releases }} path: checkbox-snap/series_${{ matrix.type }}${{ matrix.releases }}/*.snap - uses: Wandalen/wretry.action@a163f62ae554a8f3cbe27b23db15b60c0ae2e93c # v1.3.0 - name: Upload Snap to the store + name: Upload the snaps to the store with: attempt_delay: 600000 # 10min - attempt_limit: 3 + attempt_limit: 10 command: | for snap in checkbox-snap/series_${{ matrix.type }}${{ matrix.releases }}/*.snap ; \ do \