From 2ea5f77ffa531db64e49a084353b73d97a7a19a6 Mon Sep 17 00:00:00 2001 From: AIEN Date: Sun, 20 Sep 2026 02:00:10 -0500 Subject: [PATCH] feat(ci): build native amd64 and arm64 container images with unified manifest list --- .github/workflows/ci.yml | 66 +++++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16033d5..e44a470 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: CI & Container Build +name: CI & Multi-Arch Container Release on: push: @@ -28,31 +28,61 @@ jobs: - name: Run native benchmark verification run: cargo run --release -- --bench --bench-records 200 - container-build: - name: Build & Publish Container + build-amd64: + name: Build AMD64 Container runs-on: ubuntu-latest needs: test + if: github.event_name == 'push' && github.ref == 'refs/heads/main' steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to GitHub Container Registry - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - uses: docker/login-action@v3 + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: ghcr.io/${{ github.repository }}:${{ github.sha }}-amd64 - - name: Build and push Docker image - uses: docker/build-push-action@v5 + build-arm64: + name: Build ARM64 Container + runs-on: ubuntu-24.04-arm + needs: test + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/build-push-action@v5 with: context: . file: ./Dockerfile - push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} - tags: | - ghcr.io/${{ github.repository }}:latest - ghcr.io/${{ github.repository }}:${{ github.sha }} + push: true + tags: ghcr.io/${{ github.repository }}:${{ github.sha }}-arm64 + + publish-manifest: + name: Publish Multi-Arch Manifest + runs-on: ubuntu-latest + needs: [build-amd64, build-arm64] + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + steps: + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Create and push multi-arch manifest + run: | + docker buildx imagetools create \ + -t ghcr.io/${{ github.repository }}:latest \ + -t ghcr.io/${{ github.repository }}:${{ github.sha }} \ + ghcr.io/${{ github.repository }}:${{ github.sha }}-amd64 \ + ghcr.io/${{ github.repository }}:${{ github.sha }}-arm64