From 5e1baf676b09e82fa3c46029c1dd295927162ee1 Mon Sep 17 00:00:00 2001 From: PoAn Yang Date: Wed, 15 May 2024 09:54:44 +0800 Subject: [PATCH] ci: change oracle-aarch64-4cpu-16gb to longhorn-infra-arm64-runners Signed-off-by: PoAn Yang --- .github/workflows/build.yml | 37 ++++++++++--------------------------- scripts/build | 2 +- scripts/ci | 2 +- scripts/validate | 2 +- scripts/version | 2 ++ 5 files changed, 15 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d458f533d..7d0d6f35c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,13 +33,15 @@ jobs: build-arm64-binaries: name: Build ARM64 binaries - runs-on: oracle-aarch64-4cpu-16gb + runs-on: longhorn-infra-arm64-runners steps: - name: Checkout code uses: actions/checkout@v4 - name: Install make - run: sudo apt-get install make + run: | + sudo apt update + sudo apt-get -y install make curl # Build binaries - name: Run make ci @@ -54,6 +56,7 @@ jobs: build-push-amd64-images: name: Build and push AMD64 images runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/') }} needs: build-amd64-binaries steps: - name: Checkout code @@ -83,23 +86,12 @@ jobs: cp -r ./bin ./package/ - name: Login to Docker Hub - if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/') }} uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} # longhornio/longhorn-instance-manager image - - name: docker-build-longhorn-instance-manager - uses: docker/build-push-action@v5 - with: - context: . - push: false - platforms: linux/amd64 - tags: longhornio/longhorn-instance-manager:${{ env.branch }}-head-amd64 - file: package/Dockerfile - build-args: | - ARCH=amd64 - name: docker-publish-longhorn-instance-manager if: ${{ startsWith(github.ref, 'refs/heads/') }} uses: docker/build-push-action@v5 @@ -125,14 +117,17 @@ jobs: build-push-arm64-images: name: Build and push ARM64 images - runs-on: oracle-aarch64-4cpu-16gb + runs-on: longhorn-infra-arm64-runners + if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/') }} needs: build-arm64-binaries steps: - name: Checkout code uses: actions/checkout@v4 - name: Install make - run: sudo apt-get install make + run: | + sudo apt update + sudo apt-get -y install make curl - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -157,24 +152,12 @@ jobs: cp -r ./bin ./package/ - name: Login to Docker Hub - if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/') }} uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} # longhornio/longhorn-instance-manager image - - name: docker-build-longhorn-instance-manager - if: ${{ startsWith(github.ref, 'refs/heads/') }} - uses: docker/build-push-action@v5 - with: - context: . - push: false - platforms: linux/arm64 - tags: longhornio/longhorn-instance-manager:${{ env.branch }}-head-arm64 - file: package/Dockerfile - build-args: | - ARCH=arm64 - name: docker-publish-longhorn-instance-manager if: ${{ startsWith(github.ref, 'refs/heads/') }} uses: docker/build-push-action@v5 diff --git a/scripts/build b/scripts/build index 7ffb5f31f..3568a172a 100755 --- a/scripts/build +++ b/scripts/build @@ -1,5 +1,5 @@ #!/bin/bash -set -e +set -ex source $(dirname $0)/version diff --git a/scripts/ci b/scripts/ci index be33c2577..6863a3a3e 100755 --- a/scripts/ci +++ b/scripts/ci @@ -1,5 +1,5 @@ #!/bin/bash -set -e +set -ex cd $(dirname $0) diff --git a/scripts/validate b/scripts/validate index 5c83da063..3cc98689a 100755 --- a/scripts/validate +++ b/scripts/validate @@ -1,5 +1,5 @@ #!/bin/bash -set -e +set -ex cd $(dirname $0)/.. diff --git a/scripts/version b/scripts/version index df6bc2578..dfcebb743 100755 --- a/scripts/version +++ b/scripts/version @@ -1,5 +1,7 @@ #!/bin/bash +echo "$PWD" + if [ -n "$(git status --porcelain --untracked-files=no)" ]; then DIRTY="-dirty" fi