From 7d4ed79122905a15554f2286c4b19b7814753e9e Mon Sep 17 00:00:00 2001 From: Jacob Weinstock Date: Tue, 20 Aug 2024 15:23:15 -0600 Subject: [PATCH 1/3] Use GitHub actions to parallelize: A single runner has some downsides. It takes a long time. Individual actions cannot be rerun on failure. Signed-off-by: Jacob Weinstock --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5cabea..52667ea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,9 @@ jobs: build: name: Build runs-on: ubuntu-latest + strategy: + matrix: + action: [archive2disk,cexec,grub2disk,image2disk,kexec,oci2disk,qemuimg2disk,rootio,slurp,syslinux,writefile] steps: - uses: actions/checkout@v4 @@ -32,7 +35,4 @@ jobs: run: make prepare-release - name: Run Release - run: make release -j $(nprox) - - - name: Clean up Release - run: make clean-release + run: make release-${{ matrix.action }} -j $(nprox) From b37d091b1d1f1d00e6282f14ef211f6c892c8d9b Mon Sep 17 00:00:00 2001 From: Jacob Weinstock Date: Tue, 20 Aug 2024 15:34:19 -0600 Subject: [PATCH 2/3] Fix grub2disk multi-arch: The grub-bios package doesn't exist on arm64. This fixes the builds by not installing grub-bios on arm64. I don't know if this will be an issue with the functionality of grub2disk on arm64. I will need to test. Signed-off-by: Jacob Weinstock --- grub2disk/Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/grub2disk/Dockerfile b/grub2disk/Dockerfile index ed12d3a..5eb8b8d 100644 --- a/grub2disk/Dockerfile +++ b/grub2disk/Dockerfile @@ -1,7 +1,14 @@ # syntax=docker/dockerfile:1 -FROM golang:1.21-alpine as grub2disk +FROM golang:1.21-alpine AS base + +FROM base AS build-amd64 RUN apk add --no-cache grub grub-bios git ca-certificates gcc musl-dev + +FROM base AS build-arm64 +RUN apk add --no-cache grub git ca-certificates gcc musl-dev + +FROM build-${TARGETARCH} AS grub2disk COPY . /src WORKDIR /src/grub2disk RUN --mount=type=cache,sharing=locked,id=gomod,target=/go/pkg/mod/cache \ From a72b268f65a4062a4815bb4bbbce43ba9324546a Mon Sep 17 00:00:00 2001 From: Jacob Weinstock Date: Tue, 20 Aug 2024 15:43:07 -0600 Subject: [PATCH 3/3] Update CI builds to use GitHub matrix jobs: This will improve debug-ability and retries. Signed-off-by: Jacob Weinstock --- .github/workflows/ci.yml | 3 ++- .github/workflows/release.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21aaadf..c4b6612 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,9 @@ jobs: strategy: matrix: platform: [amd64] + action: [archive2disk,cexec,grub2disk,image2disk,kexec,oci2disk,qemuimg2disk,rootio,slurp,syslinux,writefile] steps: - uses: actions/checkout@v4 - name: Build linux/${{ matrix.platform }} - run: make images -j$(nproc) GOOS=linux GOARCH=${{ matrix.platform }} + run: make ${{ matrix.action }} -j$(nproc) GOOS=linux GOARCH=${{ matrix.platform }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 52667ea..4460081 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ env: jobs: build: - name: Build + name: Release runs-on: ubuntu-latest strategy: matrix: