From 987edc0b2298e39f847e513ef09e7ad8682961bc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 01:19:01 +0000 Subject: [PATCH 01/12] Initial plan From 5ad73176ce078e6d7326a13e6cc39f80cb5e21e3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 01:31:06 +0000 Subject: [PATCH 02/12] Add arm64 support to Docker image builds - Update Dockerfile to use TARGETOS and TARGETARCH build args - Remove hardcoded BINARY build arg in favor of multi-platform automatic selection - Update release.md workflow to build for linux/amd64,linux/arm64 - Update Makefile docker-build to use buildx for consistency - Update docker_build_integration_test.go to check for new ARG format Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/release.lock.yml | 12 ++++-------- .github/workflows/release.md | 10 +++------- Dockerfile | 11 +++++++---- Makefile | 9 +++++---- pkg/cli/docker_build_integration_test.go | 3 ++- 5 files changed, 21 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release.lock.yml b/.github/workflows/release.lock.yml index 858f6f13bd..ff4423f718 100644 --- a/.github/workflows/release.lock.yml +++ b/.github/workflows/release.lock.yml @@ -27,7 +27,7 @@ # Imports: # - shared/mood.md # -# frontmatter-hash: cc2b8c6b51e275896e8102fe283fdb0e690e468cd8e5693425a35d14bb622645 +# frontmatter-hash: a5680719c82cf3379019cf9cb1d23a3af798c67d011aa864b5228c59faaaa8e7 name: "Release" "on": @@ -1188,12 +1188,10 @@ jobs: - name: Build Docker image (validation only) uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6 with: - build-args: | - BINARY=dist/linux-amd64 cache-from: type=gha context: . load: false - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 push: false - name: Create GitHub release id: get_release @@ -1273,17 +1271,15 @@ jobs: type=semver,pattern={{major}} type=sha,format=long type=raw,value=latest,enable={{is_default_branch}} - - name: Build and push Docker image (amd64) + - name: Build and push Docker image (multi-platform) id: build uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6 with: - build-args: | - BINARY=dist/linux-amd64 cache-from: type=gha cache-to: type=gha,mode=max context: . labels: ${{ steps.meta.outputs.labels }} - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 provenance: mode=max push: true sbom: true diff --git a/.github/workflows/release.md b/.github/workflows/release.md index eb1d4b864e..b24e501d1a 100644 --- a/.github/workflows/release.md +++ b/.github/workflows/release.md @@ -192,11 +192,9 @@ jobs: uses: docker/build-push-action@v6 with: context: . - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 push: false load: false - build-args: | - BINARY=dist/linux-amd64 cache-from: type=gha - name: Create GitHub release @@ -287,17 +285,15 @@ jobs: type=sha,format=long type=raw,value=latest,enable={{is_default_branch}} - - name: Build and push Docker image (amd64) + - name: Build and push Docker image (multi-platform) id: build uses: docker/build-push-action@v6 with: context: . - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - build-args: | - BINARY=dist/linux-amd64 cache-from: type=gha cache-to: type=gha,mode=max sbom: true diff --git a/Dockerfile b/Dockerfile index c0681ff33b..031e5a8fd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,14 +13,17 @@ RUN apk add --no-cache \ ca-certificates \ github-cli -# Accept build argument for binary name (defaults to linux-amd64) -ARG BINARY=gh-aw-linux-amd64 +# Docker Buildx automatically provides these ARGs for multi-platform builds +ARG TARGETOS +ARG TARGETARCH # Create a directory for the binary WORKDIR /usr/local/bin -# Copy the gh-aw binary from build context -COPY ${BINARY} /usr/local/bin/gh-aw +# Copy the appropriate binary based on target platform +# TARGETOS=linux, TARGETARCH=amd64 -> dist/linux-amd64 +# TARGETOS=linux, TARGETARCH=arm64 -> dist/linux-arm64 +COPY dist/${TARGETOS}-${TARGETARCH} /usr/local/bin/gh-aw # Ensure the binary is executable RUN chmod +x /usr/local/bin/gh-aw diff --git a/Makefile b/Makefile index b1838ee540..922ec87496 100644 --- a/Makefile +++ b/Makefile @@ -270,11 +270,12 @@ docker-build: build-linux echo "Error: Docker is not installed."; \ exit 1; \ fi - @# Build for linux/amd64 by default for local testing - docker build -t $(DOCKER_IMAGE):$(VERSION) \ - --build-arg BINARY=$(BINARY_NAME)-linux-amd64 \ + @# Build for linux/amd64 by default for local testing using buildx + docker buildx build --platform linux/amd64 \ + -t $(DOCKER_IMAGE):$(VERSION) \ + -t $(DOCKER_IMAGE):latest \ + --load \ -f Dockerfile . - @docker tag $(DOCKER_IMAGE):$(VERSION) $(DOCKER_IMAGE):latest @echo "✓ Docker image built: $(DOCKER_IMAGE):$(VERSION)" @echo "✓ Docker image tagged: $(DOCKER_IMAGE):latest" diff --git a/pkg/cli/docker_build_integration_test.go b/pkg/cli/docker_build_integration_test.go index d09120f5fb..aaf5b66d15 100644 --- a/pkg/cli/docker_build_integration_test.go +++ b/pkg/cli/docker_build_integration_test.go @@ -40,7 +40,8 @@ func TestDockerfile_Exists(t *testing.T) { "git", // Git package "jq", // jq package "bash", // Bash package - "ARG BINARY", // Build argument for binary + "ARG TARGETOS", // Build argument for target OS + "ARG TARGETARCH", // Build argument for target architecture "ENTRYPOINT [\"gh-aw\"]", // Entrypoint } From 03bae5ebfa8416b0e804973503249224c1543e2d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 01:32:15 +0000 Subject: [PATCH 03/12] Improve Dockerfile with better documentation and validation - Add documentation for expected ARG values (TARGETOS, TARGETARCH) - Add note about explicit build args for local builds without buildx - Add binary validation step to fail fast if binary is missing or not executable Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 031e5a8fd9..6fcfff10e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,9 @@ RUN apk add --no-cache \ github-cli # Docker Buildx automatically provides these ARGs for multi-platform builds +# Expected values: TARGETOS=linux, TARGETARCH=amd64|arm64 +# For local builds without buildx, these must be provided explicitly: +# docker build --build-arg TARGETOS=linux --build-arg TARGETARCH=amd64 ... ARG TARGETOS ARG TARGETARCH @@ -25,8 +28,10 @@ WORKDIR /usr/local/bin # TARGETOS=linux, TARGETARCH=arm64 -> dist/linux-arm64 COPY dist/${TARGETOS}-${TARGETARCH} /usr/local/bin/gh-aw -# Ensure the binary is executable -RUN chmod +x /usr/local/bin/gh-aw +# Ensure the binary is executable and verify it exists +RUN chmod +x /usr/local/bin/gh-aw && \ + /usr/local/bin/gh-aw --version || \ + (echo "Error: gh-aw binary not found or not executable" && exit 1) # Configure git to trust all directories to avoid "dubious ownership" errors # This is necessary when the container runs with mounted volumes owned by different users From 1fc6df0e7fab9506cceb9c5711220b9c038cb49c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 01:48:18 +0000 Subject: [PATCH 04/12] Fix Makefile docker-build targets to create dist directory structure - Add dist directory preparation in docker-build and docker-build-multiarch targets - Copy binaries from repo root to dist/linux-amd64 and dist/linux-arm64 - Update TestDockerBuild_WithMake to verify dist directory structure is created - Add verification for both amd64 and arm64 binaries in tests - Add dist/${TARGETOS}-${TARGETARCH} pattern check in Dockerfile tests Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- Makefile | 8 +++++ pkg/cli/docker_build_integration_test.go | 43 +++++++++++++++++------- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 922ec87496..c552268624 100644 --- a/Makefile +++ b/Makefile @@ -270,6 +270,10 @@ docker-build: build-linux echo "Error: Docker is not installed."; \ exit 1; \ fi + @# Prepare dist directory structure for Docker build + @mkdir -p dist + @cp $(BINARY_NAME)-linux-amd64 dist/linux-amd64 + @cp $(BINARY_NAME)-linux-arm64 dist/linux-arm64 @# Build for linux/amd64 by default for local testing using buildx docker buildx build --platform linux/amd64 \ -t $(DOCKER_IMAGE):$(VERSION) \ @@ -292,6 +296,10 @@ docker-build-multiarch: build-linux echo "Install with: docker buildx install"; \ exit 1; \ fi + @# Prepare dist directory structure for Docker build + @mkdir -p dist + @cp $(BINARY_NAME)-linux-amd64 dist/linux-amd64 + @cp $(BINARY_NAME)-linux-arm64 dist/linux-arm64 @# Create buildx builder if it doesn't exist @docker buildx create --use --name gh-aw-builder 2>/dev/null || docker buildx use gh-aw-builder @# Build for multiple platforms diff --git a/pkg/cli/docker_build_integration_test.go b/pkg/cli/docker_build_integration_test.go index aaf5b66d15..7c88bbca1c 100644 --- a/pkg/cli/docker_build_integration_test.go +++ b/pkg/cli/docker_build_integration_test.go @@ -35,14 +35,15 @@ func TestDockerfile_Exists(t *testing.T) { // Verify essential components are present requiredComponents := []string{ - "FROM alpine:", // Alpine base image - "github-cli", // GitHub CLI package - "git", // Git package - "jq", // jq package - "bash", // Bash package - "ARG TARGETOS", // Build argument for target OS - "ARG TARGETARCH", // Build argument for target architecture - "ENTRYPOINT [\"gh-aw\"]", // Entrypoint + "FROM alpine:", // Alpine base image + "github-cli", // GitHub CLI package + "git", // Git package + "jq", // jq package + "bash", // Bash package + "ARG TARGETOS", // Build argument for target OS + "ARG TARGETARCH", // Build argument for target architecture + "dist/${TARGETOS}-${TARGETARCH}", // Binary path pattern + "ENTRYPOINT [\"gh-aw\"]", // Entrypoint } for _, component := range requiredComponents { @@ -125,13 +126,18 @@ func TestDockerBuild_WithMake(t *testing.T) { t.Fatalf("Failed to build Linux binary: %v", err) } - // Verify the Linux binary was created - binaryPath := filepath.Join(repoRoot, "gh-aw-linux-amd64") - if _, err := os.Stat(binaryPath); os.IsNotExist(err) { - t.Fatalf("Linux binary not found at %s", binaryPath) + // Verify the Linux binaries were created in repo root + binaryPathAmd64 := filepath.Join(repoRoot, "gh-aw-linux-amd64") + if _, err := os.Stat(binaryPathAmd64); os.IsNotExist(err) { + t.Fatalf("Linux amd64 binary not found at %s", binaryPathAmd64) } - // Build Docker image using Makefile + binaryPathArm64 := filepath.Join(repoRoot, "gh-aw-linux-arm64") + if _, err := os.Stat(binaryPathArm64); os.IsNotExist(err) { + t.Fatalf("Linux arm64 binary not found at %s", binaryPathArm64) + } + + // Build Docker image using Makefile (should create dist/ directory) t.Log("Building Docker image with make docker-build...") dockerBuildCmd := exec.Command("make", "docker-build") dockerBuildCmd.Dir = repoRoot @@ -141,6 +147,17 @@ func TestDockerBuild_WithMake(t *testing.T) { t.Fatalf("Failed to build Docker image: %v", err) } + // Verify dist directory structure was created + distAmd64Path := filepath.Join(repoRoot, "dist", "linux-amd64") + if _, err := os.Stat(distAmd64Path); os.IsNotExist(err) { + t.Errorf("dist/linux-amd64 binary not found at %s", distAmd64Path) + } + + distArm64Path := filepath.Join(repoRoot, "dist", "linux-arm64") + if _, err := os.Stat(distArm64Path); os.IsNotExist(err) { + t.Errorf("dist/linux-arm64 binary not found at %s", distArm64Path) + } + t.Log("Docker image built successfully") // Clean up Docker image after test From 8694065b1a55f5ddda81815ab46c7539a1678e2f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 01:58:56 +0000 Subject: [PATCH 05/12] Update ci.yml to use new Docker build approach with dist directory - Replace old docker build with docker buildx build for consistency - Add dist directory preparation step before Docker build - Remove obsolete --build-arg BINARY parameter - Use --platform linux/amd64 and --load flags for CI testing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00720c7694..5bf19523ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1773,11 +1773,20 @@ jobs: - name: Build Linux binary for Alpine run: make build-linux + - name: Prepare dist directory for Docker build + run: | + echo "Preparing dist directory structure..." + mkdir -p dist + cp gh-aw-linux-amd64 dist/linux-amd64 + cp gh-aw-linux-arm64 dist/linux-arm64 + echo "✅ dist directory prepared" + - name: Build Alpine Docker image run: | echo "Building Alpine Docker image..." - docker build -t gh-aw-alpine:test \ - --build-arg BINARY=gh-aw-linux-amd64 \ + docker buildx build --platform linux/amd64 \ + -t gh-aw-alpine:test \ + --load \ -f Dockerfile . echo "✅ Alpine Docker image built successfully" From 4472fc1243db245352128cb357e5b1ab229acde1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 02:15:07 +0000 Subject: [PATCH 06/12] Add ARM64 container test job to CI workflow - Add new alpine-container-test-arm64 job to test ARM64 Docker builds - Set up QEMU emulation for ARM64 architecture testing - Build and test ARM64 Docker image with --platform linux/arm64 - Run compile command and verify lock file generation on ARM64 - Test verifies ARM64 binary works correctly in Alpine container - Provides comprehensive ARM64 build validation in CI Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/ci.yml | 152 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bf19523ee..698dcbeaad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1861,6 +1861,158 @@ jobs: run: | rm -rf test-workspace + alpine-container-test-arm64: + name: Alpine Container Test (ARM64) + runs-on: ubuntu-latest + permissions: + contents: read + concurrency: + group: ci-${{ github.ref }}-alpine-container-arm64 + cancel-in-progress: true + steps: + - name: Checkout code + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 + + - name: Set up Go + id: setup-go + uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6 + with: + go-version-file: go.mod + cache: true + + - name: Report Go cache status + run: | + if [ "${{ steps.setup-go.outputs.cache-hit }}" == "true" ]; then + echo "✅ Go cache hit" >> $GITHUB_STEP_SUMMARY + else + echo "⚠️ Go cache miss" >> $GITHUB_STEP_SUMMARY + fi + + - name: Download dependencies with retry + run: | + set -e + MAX_RETRIES=3 + RETRY_DELAY=5 + + for i in $(seq 1 $MAX_RETRIES); do + echo "Attempt $i of $MAX_RETRIES: Downloading Go modules..." + if go mod download; then + echo "✅ Successfully downloaded Go modules" + break + else + if [ $i -eq $MAX_RETRIES ]; then + echo "❌ Failed to download Go modules after $MAX_RETRIES attempts" + echo "This may indicate that proxy.golang.org is unreachable" + echo "Please check network connectivity or consider vendoring dependencies" + exit 1 + fi + echo "⚠️ Download failed, retrying in ${RETRY_DELAY}s..." + sleep $RETRY_DELAY + fi + done + + - name: Verify dependencies + run: go mod verify + + - name: Build Linux binary for Alpine + run: make build-linux + + - name: Prepare dist directory for Docker build + run: | + echo "Preparing dist directory structure..." + mkdir -p dist + cp gh-aw-linux-amd64 dist/linux-amd64 + cp gh-aw-linux-arm64 dist/linux-arm64 + echo "✅ dist directory prepared" + + - name: Set up QEMU for ARM64 emulation + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build Alpine Docker image (ARM64) + run: | + echo "Building Alpine Docker image for ARM64..." + docker buildx build --platform linux/arm64 \ + -t gh-aw-alpine:test-arm64 \ + --load \ + -f Dockerfile . + echo "✅ Alpine Docker image (ARM64) built successfully" + + - name: Test Docker image basic commands (ARM64) + run: | + echo "Testing Docker image basic commands on ARM64..." + docker run --rm --platform linux/arm64 gh-aw-alpine:test-arm64 --version + docker run --rm --platform linux/arm64 gh-aw-alpine:test-arm64 --help + echo "✅ Basic commands work on ARM64" + + - name: Create test workflow in container + run: | + echo "Creating test workflow file..." + mkdir -p test-workspace/.github/workflows + cat > test-workspace/.github/workflows/test-alpine-arm64.md << 'EOF' + --- + on: push + engine: copilot + --- + # Test Workflow for Alpine Container (ARM64) + + This is a simple test workflow to verify the compile command works correctly in Alpine container on ARM64. + + ## Task + Echo hello from Alpine container (ARM64). + EOF + echo "✅ Test workflow created" + + - name: Run compile through Alpine container (ARM64) + run: | + echo "Running compile command through Alpine container (ARM64)..." + docker run --rm --platform linux/arm64 \ + -v "$(pwd)/test-workspace:/workspace" \ + -w /workspace \ + gh-aw-alpine:test-arm64 compile test-alpine-arm64 --verbose + + echo "✅ Compile command executed on ARM64" + + - name: Verify lock file generation + run: | + echo "Verifying lock file was generated..." + if [ -f "test-workspace/.github/workflows/test-alpine-arm64.lock.yml" ]; then + echo "✅ Lock file generated successfully" + echo "" + echo "Lock file contents:" + head -20 test-workspace/.github/workflows/test-alpine-arm64.lock.yml + else + echo "❌ Lock file not found" + ls -la test-workspace/.github/workflows/ + exit 1 + fi + + - name: Generate test summary + if: always() + run: | + echo "## Alpine Container Test Results (ARM64)" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "This test verifies that:" >> $GITHUB_STEP_SUMMARY + echo "1. The Alpine Docker image can be built for ARM64 architecture" >> $GITHUB_STEP_SUMMARY + echo "2. The gh-aw binary works correctly in Alpine Linux on ARM64" >> $GITHUB_STEP_SUMMARY + echo "3. The compile command can process workflows in the ARM64 container" >> $GITHUB_STEP_SUMMARY + echo "4. Lock files are generated correctly on ARM64" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + if [ -f "test-workspace/.github/workflows/test-alpine-arm64.lock.yml" ]; then + echo "✅ All ARM64 tests passed successfully" >> $GITHUB_STEP_SUMMARY + else + echo "❌ Lock file generation failed on ARM64" >> $GITHUB_STEP_SUMMARY + fi + + - name: Clean up test files + if: always() + run: | + rm -rf test-workspace + safe-outputs-conformance: runs-on: ubuntu-latest permissions: From 9b74755ed09a5822c3fabd913491e2931de71de3 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 16 Feb 2026 02:41:44 +0000 Subject: [PATCH 07/12] Add changeset [skip-ci] --- .changeset/patch-add-arm64-container-builds.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .changeset/patch-add-arm64-container-builds.md diff --git a/.changeset/patch-add-arm64-container-builds.md b/.changeset/patch-add-arm64-container-builds.md new file mode 100644 index 0000000000..0f14a9b247 --- /dev/null +++ b/.changeset/patch-add-arm64-container-builds.md @@ -0,0 +1,4 @@ +--- +"gh-aw": patch +--- +Updated the Docker build flow to use buildx and production dist layout so linux/amd64 and linux/arm64 images are produced and tested. From 1b779922586a35832cca1884983cd12427ab67eb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 02:46:23 +0000 Subject: [PATCH 08/12] Fix CI: Add Docker Buildx setup to alpine-container-test job - Add missing setup-buildx-action step before docker buildx build - Fixes CI failure in alpine-container-test job step 8 - Ensures buildx is properly initialized before building Docker images Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 698dcbeaad..170d5f579a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1781,6 +1781,9 @@ jobs: cp gh-aw-linux-arm64 dist/linux-arm64 echo "✅ dist directory prepared" + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build Alpine Docker image run: | echo "Building Alpine Docker image..." From acefcfc2e7f8d8754093a0cae6775d5a5fb38069 Mon Sep 17 00:00:00 2001 From: Coder Runner Date: Mon, 16 Feb 2026 03:32:27 +0000 Subject: [PATCH 09/12] Add changeset [skip-ci] --- .changeset/patch-document-arm64-container-builds.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .changeset/patch-document-arm64-container-builds.md diff --git a/.changeset/patch-document-arm64-container-builds.md b/.changeset/patch-document-arm64-container-builds.md new file mode 100644 index 0000000000..15c2b99ff1 --- /dev/null +++ b/.changeset/patch-document-arm64-container-builds.md @@ -0,0 +1,4 @@ +--- +"gh-aw": patch +--- +Updated the release, Makefile, CI workflows, and Docker build scripts so linux/amd64 and linux/arm64 container images are produced and validated via buildx. From e2aa789b4588eae36d71689a9449a6faed3affe9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 03:41:56 +0000 Subject: [PATCH 10/12] Add QEMU setup and improve Docker build robustness - Add QEMU setup to release.md for ARM64 cross-compilation support - Add default values to Dockerfile ARGs (TARGETOS=linux, TARGETARCH=amd64) - Add buildx availability check to Makefile docker-build target - Ensures multi-platform builds work reliably on amd64 runners - Improves local development experience with better defaults and error messages Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/release.lock.yml | 6 +++++- .github/workflows/release.md | 5 +++++ Dockerfile | 5 +++-- Makefile | 6 ++++++ 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.lock.yml b/.github/workflows/release.lock.yml index ff4423f718..ee9a757ceb 100644 --- a/.github/workflows/release.lock.yml +++ b/.github/workflows/release.lock.yml @@ -27,7 +27,7 @@ # Imports: # - shared/mood.md # -# frontmatter-hash: a5680719c82cf3379019cf9cb1d23a3af798c67d011aa864b5228c59faaaa8e7 +# frontmatter-hash: 5ab9279679b4dcbf80e9fa430e222569d154c38e53b56d06959fa443aaf617ed name: "Release" "on": @@ -1183,6 +1183,10 @@ jobs: echo "✓ Binaries built successfully" env: RELEASE_TAG: ${{ needs.config.outputs.release_tag }} + - name: Set up QEMU for multi-platform builds + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 - name: Setup Docker Buildx (pre-validation) uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 - name: Build Docker image (validation only) diff --git a/.github/workflows/release.md b/.github/workflows/release.md index b24e501d1a..ba90061845 100644 --- a/.github/workflows/release.md +++ b/.github/workflows/release.md @@ -185,6 +185,11 @@ jobs: bash scripts/build-release.sh "$RELEASE_TAG" echo "✓ Binaries built successfully" + - name: Set up QEMU for multi-platform builds + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + - name: Setup Docker Buildx (pre-validation) uses: docker/setup-buildx-action@v3 diff --git a/Dockerfile b/Dockerfile index 6fcfff10e2..f1d9386061 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,8 +17,9 @@ RUN apk add --no-cache \ # Expected values: TARGETOS=linux, TARGETARCH=amd64|arm64 # For local builds without buildx, these must be provided explicitly: # docker build --build-arg TARGETOS=linux --build-arg TARGETARCH=amd64 ... -ARG TARGETOS -ARG TARGETARCH +# Default to linux/amd64 if not provided +ARG TARGETOS=linux +ARG TARGETARCH=amd64 # Create a directory for the binary WORKDIR /usr/local/bin diff --git a/Makefile b/Makefile index c552268624..4a5f47c89a 100644 --- a/Makefile +++ b/Makefile @@ -274,6 +274,12 @@ docker-build: build-linux @mkdir -p dist @cp $(BINARY_NAME)-linux-amd64 dist/linux-amd64 @cp $(BINARY_NAME)-linux-arm64 dist/linux-arm64 + @# Check if buildx is available + @if ! docker buildx version >/dev/null 2>&1; then \ + echo "Error: Docker buildx is not available."; \ + echo "Install with: docker buildx install"; \ + exit 1; \ + fi @# Build for linux/amd64 by default for local testing using buildx docker buildx build --platform linux/amd64 \ -t $(DOCKER_IMAGE):$(VERSION) \ From d1e8b0943d0d1935026fb57f944900f6c48fc68d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 16 Feb 2026 05:39:15 +0000 Subject: [PATCH 11/12] Add changeset [skip-ci] --- .changeset/patch-arm64-container-build.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .changeset/patch-arm64-container-build.md diff --git a/.changeset/patch-arm64-container-build.md b/.changeset/patch-arm64-container-build.md new file mode 100644 index 0000000000..dc573a7b82 --- /dev/null +++ b/.changeset/patch-arm64-container-build.md @@ -0,0 +1,4 @@ +--- +"gh-aw": patch +--- +Updated the Docker/CI flow so the dist/ directories feed multi-platform linux/amd64 and linux/arm64 images built via buildx and validated via the release/CI scripts. From bf83d162af799e4a1f9193848f840ee2ce74ca2c Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 01:43:54 -0800 Subject: [PATCH 12/12] Fix Alpine container build: downgrade to 3.19 for gh CLI availability (#16050) --- .changeset/patch-fix-alpine-dockerfile.md | 5 +++++ .github/aw/actions-lock.json | 5 +++++ .github/workflows/release.lock.yml | 2 +- Dockerfile | 8 ++++---- pkg/workflow/data/action_pins.json | 5 +++++ 5 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .changeset/patch-fix-alpine-dockerfile.md diff --git a/.changeset/patch-fix-alpine-dockerfile.md b/.changeset/patch-fix-alpine-dockerfile.md new file mode 100644 index 0000000000..169f5fa823 --- /dev/null +++ b/.changeset/patch-fix-alpine-dockerfile.md @@ -0,0 +1,5 @@ +--- +"gh-aw": patch +--- + +Fix Alpine Dockerfile compilation by using Alpine 3.19 and correct gh package name diff --git a/.github/aw/actions-lock.json b/.github/aw/actions-lock.json index 0a95331f84..e86e50dd3a 100644 --- a/.github/aw/actions-lock.json +++ b/.github/aw/actions-lock.json @@ -150,6 +150,11 @@ "version": "v3.12.0", "sha": "8d2750c68a42422c14e847fe6c8ac0403b4cbd6f" }, + "docker/setup-qemu-action@v3": { + "repo": "docker/setup-qemu-action", + "version": "v3", + "sha": "c7c53464625b32c7a7e944ae62b3e17d2b600130" + }, "erlef/setup-beam@v1": { "repo": "erlef/setup-beam", "version": "v1.20.4", diff --git a/.github/workflows/release.lock.yml b/.github/workflows/release.lock.yml index ee9a757ceb..700b54bc9d 100644 --- a/.github/workflows/release.lock.yml +++ b/.github/workflows/release.lock.yml @@ -1184,7 +1184,7 @@ jobs: env: RELEASE_TAG: ${{ needs.config.outputs.release_tag }} - name: Set up QEMU for multi-platform builds - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3 with: platforms: arm64 - name: Setup Docker Buildx (pre-validation) diff --git a/Dockerfile b/Dockerfile index f1d9386061..d1a0a75026 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,17 @@ # Dockerfile for GitHub Agentic Workflows compiler # Provides a minimal container with gh-aw, gh CLI, git, and jq -# Use Alpine for minimal size (official distribution) -FROM alpine:3.21 +# Use Alpine 3.19 for minimal size (3.20+ removed gh CLI due to Python 3.12 compatibility) +FROM alpine:3.19 # Install required dependencies -RUN apk add --no-cache \ +RUN apk update && apk add --no-cache \ git \ jq \ bash \ curl \ ca-certificates \ - github-cli + gh # Docker Buildx automatically provides these ARGs for multi-platform builds # Expected values: TARGETOS=linux, TARGETARCH=amd64|arm64 diff --git a/pkg/workflow/data/action_pins.json b/pkg/workflow/data/action_pins.json index 0a95331f84..e86e50dd3a 100644 --- a/pkg/workflow/data/action_pins.json +++ b/pkg/workflow/data/action_pins.json @@ -150,6 +150,11 @@ "version": "v3.12.0", "sha": "8d2750c68a42422c14e847fe6c8ac0403b4cbd6f" }, + "docker/setup-qemu-action@v3": { + "repo": "docker/setup-qemu-action", + "version": "v3", + "sha": "c7c53464625b32c7a7e944ae62b3e17d2b600130" + }, "erlef/setup-beam@v1": { "repo": "erlef/setup-beam", "version": "v1.20.4",