From ddc7b9f141ae87c83ccbd2143f506231b1dc7e6b Mon Sep 17 00:00:00 2001 From: Liz Jeong Date: Thu, 18 Jul 2024 17:47:31 +0900 Subject: [PATCH] Refactor Linux build workflow for ARM64 only --- .github/workflows/build-and-upload.yml | 14 +------------- .github/workflows/build-darwin-amd64.yml | 6 ++---- .github/workflows/build-darwin-arm64.yml | 8 ++------ .github/workflows/build-linux-amd64.yml | 16 +++------------- .github/workflows/build-linux-arm64.yml | 15 +++------------ 5 files changed, 11 insertions(+), 48 deletions(-) diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml index 174effd7..2dca57dc 100644 --- a/.github/workflows/build-and-upload.yml +++ b/.github/workflows/build-and-upload.yml @@ -8,24 +8,12 @@ on: jobs: build-linux-amd64: uses: ./.github/workflows/build-linux-amd64.yml - with: - arch: amd64 - secrets: inherit build-linux-arm64: uses: ./.github/workflows/build-linux-arm64.yml - with: - arch: arm64 - secrets: inherit build-darwin-amd64: uses: ./.github/workflows/build-darwin-amd64.yml - # with: - # arch: amd64 - secrets: inherit build-darwin-arm64: - uses: ./.github/workflows/build-darwin-arm64.yml - # with: - # arch: arm64 - secrets: inherit \ No newline at end of file + uses: ./.github/workflows/build-darwin-arm64.yml \ No newline at end of file diff --git a/.github/workflows/build-darwin-amd64.yml b/.github/workflows/build-darwin-amd64.yml index 3cb6ffde..05006ba1 100644 --- a/.github/workflows/build-darwin-amd64.yml +++ b/.github/workflows/build-darwin-amd64.yml @@ -1,10 +1,8 @@ name: Build Darwin AMD64 + on: workflow_call: - # inputs: - # arch: - # required: true - # type: string + jobs: build: runs-on: macos-13 diff --git a/.github/workflows/build-darwin-arm64.yml b/.github/workflows/build-darwin-arm64.yml index 0acfd119..d8cb28b5 100644 --- a/.github/workflows/build-darwin-arm64.yml +++ b/.github/workflows/build-darwin-arm64.yml @@ -1,10 +1,8 @@ name: Build Darwin ARM64 + on: workflow_call: - # inputs: - # arch: - # required: true - # type: string + jobs: build: runs-on: macos-latest @@ -21,8 +19,6 @@ jobs: run: | L1_NETWORK_NAME="initiation-1" echo "L1_NETWORK_NAME=${L1_NETWORK_NAME}" >> $GITHUB_ENV - # Read MOVEVM_VERSION from config file - # MOVEVM_VERSION=$(grep MOVEVM_VERSION $GITHUB_WORKSPACE/.github/workflows/config | cut -d '=' -f2) MOVEVM_VERSION=$(go list -m github.com/initia-labs/movevm | awk '{print $2}') echo "MOVEVM_VERSION=${MOVEVM_VERSION}" >> $GITHUB_ENV echo "GOARCH=arm64" >> $GITHUB_ENV diff --git a/.github/workflows/build-linux-amd64.yml b/.github/workflows/build-linux-amd64.yml index a08d1e2c..c4f046c1 100644 --- a/.github/workflows/build-linux-amd64.yml +++ b/.github/workflows/build-linux-amd64.yml @@ -1,11 +1,7 @@ name: Build Linux AMD64 on: - workflow_call: - inputs: - arch: - required: true - type: string + workflow_call jobs: build: @@ -21,7 +17,7 @@ jobs: - name: Set environment variables run: | - echo "GOARCH=${{ inputs.arch }}" >> $GITHUB_ENV + echo "GOARCH=amd64" >> $GITHUB_ENV echo "GOOS=linux" >> $GITHUB_ENV if [[ "${GITHUB_REF}" == refs/tags/* ]]; then VERSION=${GITHUB_REF#refs/tags/} @@ -29,13 +25,7 @@ jobs: VERSION="v0.0.0-${GITHUB_SHA::8}" fi echo "VERSION=${VERSION}" >> $GITHUB_ENV - if [ "${{ inputs.arch }}" == "amd64" ]; then - echo "ARCH_NAME=x86_64" >> $GITHUB_ENV - elif [ "${{ inputs.arch }}" == "arm64" ]; then - echo "ARCH_NAME=aarch64" >> $GITHUB_ENV - else - echo "ARCH_NAME=${{ inputs.arch }}" >> $GITHUB_ENV - fi + echo "ARCH_NAME=x86_64" >> $GITHUB_ENV - name: Print environment variables run: | diff --git a/.github/workflows/build-linux-arm64.yml b/.github/workflows/build-linux-arm64.yml index ff5ea4e1..a03e5703 100644 --- a/.github/workflows/build-linux-arm64.yml +++ b/.github/workflows/build-linux-arm64.yml @@ -1,10 +1,7 @@ name: Build Linux ARM64 + on: workflow_call: - inputs: - arch: - required: true - type: string jobs: build: @@ -25,7 +22,7 @@ jobs: - name: Set environment variables run: | - echo "GOARCH=${{ inputs.arch }}" >> $GITHUB_ENV + echo "GOARCH=arm64" >> $GITHUB_ENV echo "GOOS=linux" >> $GITHUB_ENV if [[ "${GITHUB_REF}" == refs/tags/* ]]; then VERSION=${GITHUB_REF#refs/tags/} @@ -33,13 +30,7 @@ jobs: VERSION="v0.0.0-${GITHUB_SHA::8}" fi echo "VERSION=${VERSION}" >> $GITHUB_ENV - if [ "${{ inputs.arch }}" == "amd64" ]; then - echo "ARCH_NAME=x86_64" >> $GITHUB_ENV - elif [ "${{ inputs.arch }}" == "arm64" ]; then - echo "ARCH_NAME=aarch64" >> $GITHUB_ENV - else - echo "ARCH_NAME=${{ inputs.arch }}" >> $GITHUB_ENV - fi + echo "ARCH_NAME=aarch64" >> $GITHUB_ENV - name: Build for ARM64 env: