From bf5862e056b38c6dddfcb3d893810ae75f2c43ae Mon Sep 17 00:00:00 2001 From: shahnawaz-creator Date: Wed, 11 Dec 2024 22:37:07 +0530 Subject: [PATCH 1/2] added build for macos arm64 --- .github/workflows/build-zbox.yaml | 55 +++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-zbox.yaml b/.github/workflows/build-zbox.yaml index 3e0e792c..1495e147 100644 --- a/.github/workflows/build-zbox.yaml +++ b/.github/workflows/build-zbox.yaml @@ -104,8 +104,8 @@ jobs: rm -Recurse ${{github.workspace}}\* shell: powershell - build-macos: - name: Build-macos + build-macos-amd64: + name: Build-macos-amd64 runs-on: macos-runner steps: @@ -123,10 +123,59 @@ jobs: - name: 'Upload Artifact' uses: actions/upload-artifact@v3 with: - name: zbox-macos + name: zbox-macos-amd64 path: zbox retention-days: 5 - name: cleanup workspace run: | rm -rf ./* + + build-macos-arm64: + name: Build-macos-arm64 + runs-on: macos-runner + env: + SRC_DIR: ${{ github.workspace }}/src + OUTPUT_DIR: ${{ github.workspace }}/output + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + path: ${{ env.SRC_DIR }} + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.22' + + - name: Setup + run : | + mkdir -p ${{ env.OUTPUT_DIR }}/arm64 + cp ${{ env.SRC_DIR }}/cmd/config.yaml ${{ env.OUTPUT_DIR }}/arm64/ + + - name: Build macos for arm64 + run: | + cd ${{ env.SRC_DIR }} + CGO_ENABLED=1 CGO_CFLAGS="-mmacosx-version-min=12.0" CGO_LDFLAGS="-mmacosx-version-min=12.0" GOOS=darwin GOARCH=arm64 SDKROOT=$(xcrun --sdk macosx --show-sdk-path) go build -x -v -tags bn256 -ldflags "-X main.VersionStr=v${{ env.VERSION }}" -o ${{ env.OUTPUT_DIR }}/arm64/macos-arm64 . + + - name: Create Zip File for darwin/arm64 + run: | + cd ${{ env.OUTPUT_DIR }}/arm64 + zip -qq -r macos-arm64-darwin-arm64.zip macos-arm64 config.yaml + + - name: Upload Zip for Darwin/arm64 + uses: actions/upload-artifact@v3 + with: + name: macos-arm64-darwin-arm64 + path: ${{ env.OUTPUT_DIR }}/arm64/macos-arm64-darwin-arm64.zip + + - name: 'Upload Artifact' + uses: actions/upload-artifact@v3 + with: + name: zbox-macos-arm64 + path: ${{ env.OUTPUT_DIR }}/arm64/macos-arm64-darwin-arm64.zip + retention-days: 5 + + - name: cleanup workspace + run: | + rm -rf ./* From 8f3c43c5394d576cc4abef37f7c4de61752b9a03 Mon Sep 17 00:00:00 2001 From: shahnawaz-creator Date: Wed, 11 Dec 2024 22:49:07 +0530 Subject: [PATCH 2/2] fixed upload artifact duplication --- .github/workflows/build-zbox.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/build-zbox.yaml b/.github/workflows/build-zbox.yaml index 1495e147..600f636d 100644 --- a/.github/workflows/build-zbox.yaml +++ b/.github/workflows/build-zbox.yaml @@ -162,12 +162,6 @@ jobs: run: | cd ${{ env.OUTPUT_DIR }}/arm64 zip -qq -r macos-arm64-darwin-arm64.zip macos-arm64 config.yaml - - - name: Upload Zip for Darwin/arm64 - uses: actions/upload-artifact@v3 - with: - name: macos-arm64-darwin-arm64 - path: ${{ env.OUTPUT_DIR }}/arm64/macos-arm64-darwin-arm64.zip - name: 'Upload Artifact' uses: actions/upload-artifact@v3