diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 38931828..9070b088 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -19,9 +19,17 @@ jobs: contents: read runs-on: ubuntu-latest timeout-minutes: 10 + strategy: + fail-fast: true + matrix: + arch: [amd64, arm64] steps: - name: Checkout code uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Setup Go uses: actions/setup-go@v5 with: @@ -34,11 +42,14 @@ jobs: - name: Build run: | ./scripts/ci + env: + GOARCH: ${{ matrix.arch }} + ARCH: ${{ matrix.arch }} - name: Upload rke-etcd-backup artifact if: github.event_name == 'push' && github.ref_type == 'tag' uses: actions/upload-artifact@v4 with: - name: rke-etcd-backup-${{ github.run_number }}-${{ github.run_attempt }} + name: rke-etcd-backup-${{ github.run_number }}-${{ github.run_attempt }}-${{ matrix.arch }} path: bin/rke-etcd-backup if-no-files-found: error retention-days: 1 @@ -61,7 +72,7 @@ jobs: - name: Download rke-etcd-backup artifact uses: actions/download-artifact@v4 with: - name: rke-etcd-backup-${{ github.run_number }}-${{ github.run_attempt }} + name: rke-etcd-backup-${{ github.run_number }}-${{ github.run_attempt }}-${{ matrix.arch }} path: . - name: Fix permissions run: | diff --git a/scripts/package b/scripts/package index 941beae2..c6808a48 100755 --- a/scripts/package +++ b/scripts/package @@ -20,7 +20,7 @@ cp ../bin/rke-etcd-backup . cp -r ../{conf.d,cert-deployer,templates,nginx-proxy,*.sh} . IMAGE=${REPO}/rke-tools:${TAG} -docker build --build-arg ARCH=${ARCH} -t ${IMAGE} . +docker buildx build --build-arg ARCH=${ARCH} -t ${IMAGE} --platform linux/${ARCH} . mkdir -p ../dist echo ${IMAGE} > ../dist/images echo Built ${IMAGE}