diff --git a/.github/workflows/binary_artifact.yml b/.github/workflows/binary_artifact.yml index 4b21d976db0f80..4feef18eccd408 100644 --- a/.github/workflows/binary_artifact.yml +++ b/.github/workflows/binary_artifact.yml @@ -38,13 +38,13 @@ jobs: uses: actions/upload-artifact@v3 with: name: linux - path: v_linux.zip + path: ${{ env.ZIPNAME }} - build-macos: + build-macos-x86_64: runs-on: macos-latest env: CC: clang - ZIPNAME: v_macos.zip + ZIPNAME: v_macos_x86_64.zip steps: - uses: actions/checkout@v1 - name: Compile @@ -70,7 +70,40 @@ jobs: uses: actions/upload-artifact@v3 with: name: macos - path: v_macos.zip + path: ${{ env.ZIPNAME }} + + build-macos-arm64: + runs-on: macos-latest + env: + CC: clang + CFLAGS: -target arm64-apple-darwin + ZIPNAME: v_macos_arm64.zip + steps: + - uses: actions/checkout@v1 + - name: Compile + run: | + make + ./v -skip-unused -cc $CC -cflags "$CFLAGS" -prod -o v cmd/v + ./v -skip-unused -cc $CC -cflags "$CFLAGS" -prod cmd/tools/vup.v + ./v -skip-unused -cc $CC -cflags "$CFLAGS" -prod cmd/tools/vdoctor.v + - name: Remove excluded + run: | + rm -rf .git/ + rm -rf thirdparty/tcc/.git/ + rm -rf vc/ + rm -rf v_old + rm -rf vlib/v/tests/bench/gcboehm/*.svg + - name: Create ZIP archive + run: | + cd .. + zip -r9 --symlinks $ZIPNAME v/ + mv $ZIPNAME v/ + cd v/ + - name: Create artifact + uses: actions/upload-artifact@v3 + with: + name: macos + path: ${{ env.ZIPNAME }} build-windows: runs-on: windows-latest @@ -110,11 +143,11 @@ jobs: uses: actions/upload-artifact@v3 with: name: windows - path: v_windows.zip + path: ${{ env.ZIPNAME }} release: name: Create Github Release - needs: [build-linux, build-windows, build-macos] + needs: [build-linux, build-windows, build-macos-x86_64, build-macos-arm64] runs-on: ubuntu-20.04 steps: - name: Get short tag name diff --git a/.github/workflows/prebuilt.yml b/.github/workflows/prebuilt.yml index 1e19472e354305..080b281908e1c2 100644 --- a/.github/workflows/prebuilt.yml +++ b/.github/workflows/prebuilt.yml @@ -24,7 +24,7 @@ jobs: cd v ./v run examples/hello_world.v - macos: + macos-x86_64: runs-on: macOS-latest timeout-minutes: 5 steps: @@ -36,8 +36,8 @@ jobs: - name: Download V run: | tag=${GITHUB_REF##*/} - wget https://github.com/vlang/v/releases/download/$tag/v_macos.zip - unzip v_macos.zip + wget https://github.com/vlang/v/releases/download/$tag/v_macos_x86_64.zip + unzip v_macos_x86_64.zip cd v ./v -version - name: Test V @@ -45,6 +45,10 @@ jobs: cd v ./v run examples/hello_world.v + # NOTE: we cannot currently test the macos arm64 build without a apple silicon runner + # the arm64 release is cross compiled from intel. the apple silicon hosted runner is + # only currently available on the macos-latest-xlarge plan, not on the free plans. + windows: runs-on: windows-latest timeout-minutes: 5