Skip to content

Commit

Permalink
ci: add macos arm64 binary release (#19823)
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-conigliaro committed Nov 9, 2023
1 parent cd2e36a commit 78709b0
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 9 deletions.
45 changes: 39 additions & 6 deletions .github/workflows/binary_artifact.yml
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/prebuilt.yml
Expand Up @@ -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:
Expand All @@ -36,15 +36,19 @@ 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
run: |
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
Expand Down

0 comments on commit 78709b0

Please sign in to comment.