Skip to content

Commit

Permalink
ci: use build matrix to build images and variants (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
reubenmiller authored Dec 3, 2023
1 parent 5d10f52 commit 9e7db30
Showing 1 changed file with 29 additions and 15 deletions.
44 changes: 29 additions & 15 deletions .github/workflows/bake-image.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,52 @@
name: Bake Image

on:
workflow_dispatch:
push:
branches:
- main
- ci

env:
PI_BASE_IMAGE: "https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2023-10-10/2023-10-10-raspios-bookworm-arm64-lite.img.xz"

jobs:
info:
name: Build information
runs-on: ubuntu-latest
outputs:
version: ${{ steps.step1.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: extractions/setup-just@v1
- id: step1
run: echo "version=$(just generate_version)" >> "$GITHUB_OUTPUT"

bake-image:
name: Bake Image
name: Bake Image ${{ matrix.job.arch }} - ${{ matrix.job.profile }} - ${{ matrix.job.variant }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
job:
- { arch: armhf, profile: armhf, variant: pi01 }
- { arch: arm64, profile: default, variant: pi023 }
- { arch: arm64, profile: default, variant: pi4 }
- { arch: arm64, profile: default, variant: pi45 }
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: extractions/setup-just@v1

- name: Install QEMU
run: docker run --privileged --rm tonistiigi/binfmt --install arm64,armhf

- name: Set image version
run: echo "VERSION=$(just generate_version)" >> $GITHUB_ENV

- name: Build image
env:
VERSION: ${{needs.info.outputs.version}}
run: |
mkdir build
just build-all-variants
just IMAGE_ARCH=${{ matrix.job.arch }} PROFILE=${{ matrix.job.profile }} VARIANT=${{ matrix.job.variant }} build-all
- name: Upload Image
uses: actions/upload-artifact@v3
with:
name: images
path: build/*.xz
name: tedge_rugpi_${{matrix.job.profile}}_${{matrix.job.variant}}_${{version}}
path: build/tedge_rugpi_${{matrix.job.profile}}_${{matrix.job.variant}}_${{version}}*.xz

0 comments on commit 9e7db30

Please sign in to comment.