From 0fa107fe21d85ce560a5d9f1065f8f90c8ff7b53 Mon Sep 17 00:00:00 2001 From: Kirill Azovtsev Date: Mon, 27 Jan 2025 01:32:38 +0300 Subject: [PATCH] CI - update zombie builder build steps --- .github/workflows/zombie-builder.yml | 74 +++++++++++++++++++++++++--- 1 file changed, 68 insertions(+), 6 deletions(-) diff --git a/.github/workflows/zombie-builder.yml b/.github/workflows/zombie-builder.yml index 067e270f59..0cf9ee731a 100644 --- a/.github/workflows/zombie-builder.yml +++ b/.github/workflows/zombie-builder.yml @@ -67,8 +67,17 @@ env: jobs: build_polkadot_builder: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - platform: linux/amd64 + os: ubuntu-24.04 + - platform: linux/arm64 + os: ubuntu-24.04-arm timeout-minutes: 60 + env: + PLATFORM: ${{ matrix.platform }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -103,7 +112,53 @@ jobs: - name: "Build Polkadot Builder" working-directory: ./zombienet/docker if: env.exists == 'false' || github.event.inputs.polkadot_builder == 'true' - run: make polkadot_builder_all_arch + run: make polkadot_builder && make polkadot_builder_push + + - name: "Versions Info" + if: always() + working-directory: ./zombienet/docker + run: | + make polkadot_builder_image_info + + docker_manifest: + runs-on: ubuntu-24.04 + timeout-minutes: 60 + needs: [build_polkadot_builder] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Fetch master branch + run: git fetch origin master:master + + - name : "Authenticate with Google Cloud" + uses: 'google-github-actions/auth@v2' + with: + credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} + + - name: "Set up Cloud SDK" + uses: 'google-github-actions/setup-gcloud@v2' + + - name: "Configure Docker for GCR" + run: | + gcloud auth configure-docker --quiet + gcloud auth configure-docker ${{ secrets.GCP_REGISTRY }} --quiet + + - name: "Check if image tag exists using Makefile" + id: check-tag + working-directory: ./zombienet/docker + run: | + make set_versions + exists=$(make polkadot_builder_check_tag) + echo "Image Exists: $exists" + echo "exists=$exists" >> $GITHUB_ENV + + - name: "Build Polkadot Builder" + working-directory: ./zombienet/docker + if: env.exists == 'false' || github.event.inputs.polkadot_builder == 'true' + run: make polkadot_builder_push_manifest - name: "Versions Info" if: always() @@ -122,13 +177,20 @@ jobs: # os: ubuntu-24.04 # - platform: linux/arm64 # os: ubuntu-24.04-arm - needs: [build_polkadot_builder] + needs: + - build_polkadot_builder + - docker_manifest timeout-minutes: 120 steps: - name: Checkout repository uses: actions/checkout@v4 - + with: + fetch-depth: 0 + + - name: Fetch master branch + run: git fetch origin master:master + - uses: actions/cache@v4 with: path: ${{ env.CACHE_PATHS }} @@ -148,12 +210,12 @@ jobs: gcloud auth configure-docker ${{ secrets.GCP_REGISTRY }} --quiet - name: "Build target" - if: github.event.inputs.polkadot_binaries == true + if: github.event.inputs.polkadot_binaries == 'true' working-directory: ./zombienet/docker run: make polkadot_binary - name: "Push Polkadot APT Package" - if: github.event.inputs.polkadot_binaries == true + if: github.event.inputs.polkadot_binaries == 'true' working-directory: ./zombienet/docker run: make upload_apt_package