-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use build matrix to build images and variants (#14)
- Loading branch information
1 parent
5d10f52
commit 9e7db30
Showing
1 changed file
with
29 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
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 |