From 78ef9436e6005dbca4b8ec038a05bf7fbbc9e7cb Mon Sep 17 00:00:00 2001 From: Aman Singh Date: Wed, 26 Feb 2025 23:13:32 -0800 Subject: [PATCH] Separate Build step for arm64 Separate the steps for: sources reactions query-container control-plane Use if-condition in build-reaction steps --- .github/workflows/draft-release.yml | 52 ++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index bad56e3b3..cafc43e99 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -102,13 +102,21 @@ jobs: restore-keys: | buildx-${{ matrix.component.name }} - - name: Build and Push to GHCR + - name: Build and Push to GHCR for amd64 run: | cd ${{ matrix.component.path }} DOCKER_TAG_VERSION=${{ inputs.tag }} \ IMAGE_PREFIX=${{ inputs.image_prefix }} \ - DOCKERX_OPTS="--push --platform linux/amd64,linux/arm64 --cache-to type=local,dest=/tmp/.buildx-cache,mode=max --cache-from type=local,src=/tmp/.buildx-cache" \ - make + DOCKERX_OPTS="--push --platform linux/amd64 --cache-to type=local,dest=/tmp/.buildx-cache,mode=max --cache-from type=local,src=/tmp/.buildx-cache" \ + make + + - name: Build and Push to GHCR for arm64 + run: | + cd ${{ matrix.component.path }} + DOCKER_TAG_VERSION=${{ inputs.tag }} \ + IMAGE_PREFIX=${{ inputs.image_prefix }} \ + DOCKERX_OPTS="--push --platform linux/arm64 --cache-to type=local,dest=/tmp/.buildx-cache,mode=max --cache-from type=local,src=/tmp/.buildx-cache" \ + make build-control-plane: runs-on: ubuntu-latest @@ -159,12 +167,20 @@ jobs: restore-keys: | buildx-${{ matrix.component.name }} - - name: Build and Push to GHCR + - name: Build and Push to GHCR for amd64 + run: | + cd ${{ matrix.component.path }} + DOCKER_TAG_VERSION=${{ inputs.tag }} \ + IMAGE_PREFIX=${{ inputs.image_prefix }} \ + DOCKERX_OPTS="--push --platform linux/amd64 --cache-to type=local,dest=/tmp/.buildx-cache,mode=max --cache-from type=local,src=/tmp/.buildx-cache" \ + make + + - name: Build and Push to GHCR for arm64 run: | cd ${{ matrix.component.path }} DOCKER_TAG_VERSION=${{ inputs.tag }} \ IMAGE_PREFIX=${{ inputs.image_prefix }} \ - DOCKERX_OPTS="--push --platform linux/amd64,linux/arm64 --cache-to type=local,dest=/tmp/.buildx-cache,mode=max --cache-from type=local,src=/tmp/.buildx-cache" \ + DOCKERX_OPTS="--push --platform linux/arm64 --cache-to type=local,dest=/tmp/.buildx-cache,mode=max --cache-from type=local,src=/tmp/.buildx-cache" \ make @@ -274,12 +290,20 @@ jobs: restore-keys: | buildx-${{ matrix.component.name }} - - name: Build and Push to GHCR + - name: Build and Push to GHCR for amd64 + run: | + cd ${{ matrix.component.path }} + DOCKER_TAG_VERSION=${{ inputs.tag }} \ + IMAGE_PREFIX=${{ inputs.image_prefix }} \ + DOCKERX_OPTS="--push --platform linux/amd64 --cache-to type=local,dest=/tmp/.buildx-cache,mode=max --cache-from type=local,src=/tmp/.buildx-cache" \ + make + + - name: Build and Push to GHCR for arm64 run: | cd ${{ matrix.component.path }} DOCKER_TAG_VERSION=${{ inputs.tag }} \ IMAGE_PREFIX=${{ inputs.image_prefix }} \ - DOCKERX_OPTS="--push --platform linux/amd64,linux/arm64 --cache-to type=local,dest=/tmp/.buildx-cache,mode=max --cache-from type=local,src=/tmp/.buildx-cache" \ + DOCKERX_OPTS="--push --platform linux/arm64 --cache-to type=local,dest=/tmp/.buildx-cache,mode=max --cache-from type=local,src=/tmp/.buildx-cache" \ make build-reactions: @@ -375,12 +399,22 @@ jobs: restore-keys: | buildx-${{ matrix.component.name }} - - name: Build and Push to GHCR + - name: Build and Push to GHCR for amd64 + if: contains(matrix.component.platforms, 'linux/amd64') + run: | + cd ${{ matrix.component.path }} + DOCKER_TAG_VERSION=${{ inputs.tag }} \ + IMAGE_PREFIX=${{ inputs.image_prefix }} \ + DOCKERX_OPTS="--push --platform linux/amd64 --cache-to type=local,dest=/tmp/.buildx-cache,mode=max --cache-from type=local,src=/tmp/.buildx-cache" \ + make + + - name: Build and Push to GHCR for arm64 + if: contains(matrix.component.platforms, 'linux/arm64') run: | cd ${{ matrix.component.path }} DOCKER_TAG_VERSION=${{ inputs.tag }} \ IMAGE_PREFIX=${{ inputs.image_prefix }} \ - DOCKERX_OPTS="--push --platform ${{ matrix.component.platforms }} --cache-to type=local,dest=/tmp/.buildx-cache,mode=max --cache-from type=local,src=/tmp/.buildx-cache" \ + DOCKERX_OPTS="--push --platform linux/arm64 --cache-to type=local,dest=/tmp/.buildx-cache,mode=max --cache-from type=local,src=/tmp/.buildx-cache" \ make build-cli: