Skip to content

Checkbox Snap daily cross-builds #54

Checkbox Snap daily cross-builds

Checkbox Snap daily cross-builds #54

name: Checkbox Snap daily cross-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:
strategy:
fail-fast: false
matrix:
release: [16, 18, 20, 22, 24]
arch: [armhf]
include:
# other confs built natively in checkbox-daily-native-builds.yaml
- release: 16
arch: amd64
- release: 16
arch: arm64
# uc16 needs ubuntu20 because we need cgroup v1 to build it
runs-on: ${{ matrix.release == 16 && fromJson('["self-hosted", "focal"]') || 'ubuntu-latest' }}
timeout-minutes: 1200 #20h, this will timeout sooner due to inner timeouts
name: Runtime ${{ matrix.release }} (${{ matrix.arch }})
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
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 }}
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
- id: snap_build
name: Build (retries on fail)
uses: Wandalen/wretry.action@71a909ebf09f3ffdc6f42a17bd54ecb43481da49
with:
attempt_limit: 5
action: canonical/snapcraft-multiarch-action@v1
with: |
architecture: ${{ matrix.arch }}
path: checkbox-core-snap/series${{ matrix.release }}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
name: Upload logs on failure
if: failure()
with:
name: runtime-build-log-${{ matrix.release }}-${{ matrix.arch }}
path: |
/home/runner/.cache/snapcraft/log/
/home/runner/.local/state/snapcraft/log/
checkbox-core-snap/series${{ matrix.release }}/checkbox*.txt
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
name: Upload the snap as artifact
with:
name: runtime_snap${{ matrix.release }}_${{ matrix.arch }}.snap
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:
strategy:
fail-fast: false
matrix:
type: [classic, uc]
release: [16, 18, 20, 22, 24]
arch: [armhf, amd64, arm64]
exclude:
# other confs built natively in checkbox-daily-native-builds.yaml
- release: 18
arch: amd64
- release: 18
arch: arm64
- release: 20
arch: amd64
- release: 20
arch: arm64
- release: 22
arch: amd64
- release: 22
arch: arm64
- release: 24
arch: amd64
- release: 24
arch: arm64
# uc16 needs ubuntu20 because we need cgroup v1 to build it
runs-on: ${{ matrix.release == 16 && fromJson('["self-hosted", "focal"]') || 'ubuntu-latest' }}
timeout-minutes: 1200 #20h, this will timeout sooner due to inner timeouts
name: Frontend ${{ matrix.type }}${{ matrix.release }} (${{ matrix.arch }})
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
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 }}
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
- id: snap_build
name: Build (retries on fail)
uses: Wandalen/wretry.action@71a909ebf09f3ffdc6f42a17bd54ecb43481da49
with:
attempt_limit: 5
action: canonical/snapcraft-multiarch-action@v1
with: |
architecture: ${{ matrix.arch }}
path: checkbox-snap/series_${{ matrix.type }}${{ matrix.release }}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
name: Upload logs on failure
if: failure()
with:
name: frontend-build-log-${{ 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@ea165f8d65b6e75b540449e92b4886f43607fa02
name: Upload the snaps as artefacts
with:
name: frontend_snaps_${{ matrix.type }}${{ matrix.release }}_${{matrix.arch}}.snap
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