Checkbox Snap daily native builds #87
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Checkbox Snap daily native builds | |
| permissions: | |
| contents: read | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| store_upload: | |
| description: 'Should the workflow upload to the store?' | |
| default: false | |
| required: false | |
| type: boolean | |
| workflow_call: | |
| inputs: | |
| store_upload: | |
| description: 'Should the workflow upload to the store?' | |
| default: false | |
| required: false | |
| type: boolean | |
| secrets: | |
| SNAPCRAFT7_CREDS: | |
| required: true | |
| jobs: | |
| snap_runtime_native: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # other confs cross-built by checkbox-daily-cross-build.yaml | |
| release: [18, 20, 22, 24] | |
| arch: [amd64, arm64] | |
| include: | |
| - arch: amd64 | |
| tag: X64 | |
| - arch: arm64 | |
| tag: ARM64 | |
| - release: 18 | |
| snapcraft_version: 7.x | |
| - release: 20 | |
| snapcraft_version: 7.x | |
| - release: 22 | |
| snapcraft_version: 8.x | |
| - release: 24 | |
| snapcraft_version: 8.x | |
| runs-on: | |
| group: "Canonical self-hosted runners" | |
| labels: ["self-hosted", "linux", "large", "${{ matrix.tag }}"] | |
| timeout-minutes: 1200 #20h, this will timeout sooner due to inner timeouts | |
| name: Runtime ${{ matrix.release }} (${{matrix.arch}}) | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Copy over the common files for series ${{ matrix.release }} | |
| run: | | |
| cd checkbox-core-snap/ | |
| sudo apt update && sudo apt install -qq -y python3-setuptools-scm | |
| ./prepare.sh series${{ matrix.release }} | |
| - id: snap_build | |
| uses: Wandalen/wretry.action@71a909ebf09f3ffdc6f42a17bd54ecb43481da49 | |
| name: Build the snap | |
| timeout-minutes: 600 # 10hours | |
| with: | |
| action: snapcore/action-build@v1.3.0 | |
| attempt_delay: 600000 # 10min | |
| attempt_limit: 5 | |
| with: | | |
| path: checkbox-core-snap/series${{ matrix.release }} | |
| snapcraft-channel: ${{ matrix.snapcraft_version }}/stable | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f | |
| name: Upload logs on failure | |
| if: failure() | |
| with: | |
| name: snapcraft-log-series${{ matrix.release }} | |
| path: | | |
| /home/runner/.cache/snapcraft/log/ | |
| /home/runner/.local/state/snapcraft/log/ | |
| checkbox-core-snap/series${{ matrix.release }}/checkbox*.txt | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f | |
| name: Upload the snap as artifact | |
| with: | |
| name: checkbox${{ matrix.release }}_${{ matrix.arch }} | |
| path: ${{ steps.snap_build.outputs.snap }} | |
| - name: Publish track | |
| if: inputs.store_upload | |
| uses: canonical/action-publish@214b86e5ca036ead1668c79afb81e550e6c54d40 | |
| env: | |
| SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT7_CREDS }} | |
| with: | |
| snap: ${{ steps.snap_build.outputs.snap }} | |
| release: latest/edge | |
| snap_frontend_native: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # other confs cross-built by checkbox-daily-cross-build.yaml | |
| type: [classic, uc] | |
| release: [18, 20, 22, 24] | |
| arch: [amd64, arm64] | |
| include: | |
| - arch: amd64 | |
| tag: X64 | |
| - arch: arm64 | |
| tag: ARM64 | |
| - release: 18 | |
| snapcraft_version: 7.x | |
| - release: 20 | |
| snapcraft_version: 7.x | |
| - release: 22 | |
| snapcraft_version: 8.x | |
| - release: 24 | |
| snapcraft_version: 8.x | |
| runs-on: | |
| group: "Canonical self-hosted runners" | |
| labels: ["self-hosted", "linux", "jammy", "large", "${{ matrix.tag }}"] | |
| timeout-minutes: 1200 #20h, this will timeout sooner due to inner timeouts | |
| name: Frontend ${{ matrix.type }}${{ matrix.release }} (${{matrix.arch}}) | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Copy over the common files for series ${{ matrix.type }}${{ matrix.release }} | |
| run: | | |
| cd checkbox-snap/ | |
| sudo apt update && sudo apt install -qq -y python3-setuptools-scm | |
| ./prepare_${{ matrix.type }}.sh series_${{ matrix.type }}${{ matrix.release }} | |
| - id: snap_build | |
| uses: Wandalen/wretry.action@71a909ebf09f3ffdc6f42a17bd54ecb43481da49 | |
| name: Building the snaps | |
| timeout-minutes: 600 # 10hours | |
| with: | |
| action: snapcore/action-build@v1.3.0 | |
| attempt_delay: 600000 # 10min | |
| attempt_limit: 5 | |
| with: | | |
| path: checkbox-snap/series_${{ matrix.type }}${{ matrix.release }} | |
| snapcraft-channel: ${{ matrix.snapcraft_version }}/stable | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f | |
| name: Upload logs on failure | |
| if: failure() | |
| with: | |
| name: snapcraft-log-series-${{ matrix.type }}${{ matrix.release }}${{ matrix.arch }} | |
| path: | | |
| /home/runner/.cache/snapcraft/log/ | |
| /home/runner/.local/state/snapcraft/log/ | |
| checkbox-snap/series_${{ matrix.type }}${{ matrix.release }}/checkbox*.txt | |
| - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f | |
| name: Upload the snaps as artefacts | |
| with: | |
| name: series_${{ matrix.type }}${{ matrix.release }}${{ matrix.arch }} | |
| path: ${{ steps.snap_build.outputs.snap }} | |
| - name: Publish track | |
| # this is done this way because the store doesn't allow the same artifact to be uploaded twice | |
| if: inputs.store_upload && (matrix.release != 24 || matrix.type != 'classic') | |
| uses: canonical/action-publish@214b86e5ca036ead1668c79afb81e550e6c54d40 | |
| env: | |
| SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT7_CREDS }} | |
| with: | |
| snap: ${{ steps.snap_build.outputs.snap }} | |
| # channel is ucXX for uc snaps and XX.04 for classic snaps | |
| release: ${{ matrix.type == 'uc' && format('uc{0}', matrix.release) || format('{0}.04', matrix.release) }}/edge | |
| - name: Publish track + latest | |
| if: inputs.store_upload && matrix.release == 24 && matrix.type == 'classic' | |
| uses: canonical/action-publish@214b86e5ca036ead1668c79afb81e550e6c54d40 | |
| env: | |
| SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT7_CREDS }} | |
| with: | |
| snap: ${{ steps.snap_build.outputs.snap }} | |
| # classic 24.04 is published to latest/edge as well | |
| release: 24.04/edge,latest/edge |