Skip to content

Commit 78709b0

Browse files
ci: add macos arm64 binary release (#19823)
1 parent cd2e36a commit 78709b0

File tree

2 files changed

+46
-9
lines changed

2 files changed

+46
-9
lines changed

.github/workflows/binary_artifact.yml

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ jobs:
3838
uses: actions/upload-artifact@v3
3939
with:
4040
name: linux
41-
path: v_linux.zip
41+
path: ${{ env.ZIPNAME }}
4242

43-
build-macos:
43+
build-macos-x86_64:
4444
runs-on: macos-latest
4545
env:
4646
CC: clang
47-
ZIPNAME: v_macos.zip
47+
ZIPNAME: v_macos_x86_64.zip
4848
steps:
4949
- uses: actions/checkout@v1
5050
- name: Compile
@@ -70,7 +70,40 @@ jobs:
7070
uses: actions/upload-artifact@v3
7171
with:
7272
name: macos
73-
path: v_macos.zip
73+
path: ${{ env.ZIPNAME }}
74+
75+
build-macos-arm64:
76+
runs-on: macos-latest
77+
env:
78+
CC: clang
79+
CFLAGS: -target arm64-apple-darwin
80+
ZIPNAME: v_macos_arm64.zip
81+
steps:
82+
- uses: actions/checkout@v1
83+
- name: Compile
84+
run: |
85+
make
86+
./v -skip-unused -cc $CC -cflags "$CFLAGS" -prod -o v cmd/v
87+
./v -skip-unused -cc $CC -cflags "$CFLAGS" -prod cmd/tools/vup.v
88+
./v -skip-unused -cc $CC -cflags "$CFLAGS" -prod cmd/tools/vdoctor.v
89+
- name: Remove excluded
90+
run: |
91+
rm -rf .git/
92+
rm -rf thirdparty/tcc/.git/
93+
rm -rf vc/
94+
rm -rf v_old
95+
rm -rf vlib/v/tests/bench/gcboehm/*.svg
96+
- name: Create ZIP archive
97+
run: |
98+
cd ..
99+
zip -r9 --symlinks $ZIPNAME v/
100+
mv $ZIPNAME v/
101+
cd v/
102+
- name: Create artifact
103+
uses: actions/upload-artifact@v3
104+
with:
105+
name: macos
106+
path: ${{ env.ZIPNAME }}
74107

75108
build-windows:
76109
runs-on: windows-latest
@@ -110,11 +143,11 @@ jobs:
110143
uses: actions/upload-artifact@v3
111144
with:
112145
name: windows
113-
path: v_windows.zip
146+
path: ${{ env.ZIPNAME }}
114147

115148
release:
116149
name: Create Github Release
117-
needs: [build-linux, build-windows, build-macos]
150+
needs: [build-linux, build-windows, build-macos-x86_64, build-macos-arm64]
118151
runs-on: ubuntu-20.04
119152
steps:
120153
- name: Get short tag name

.github/workflows/prebuilt.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
cd v
2525
./v run examples/hello_world.v
2626
27-
macos:
27+
macos-x86_64:
2828
runs-on: macOS-latest
2929
timeout-minutes: 5
3030
steps:
@@ -36,15 +36,19 @@ jobs:
3636
- name: Download V
3737
run: |
3838
tag=${GITHUB_REF##*/}
39-
wget https://github.com/vlang/v/releases/download/$tag/v_macos.zip
40-
unzip v_macos.zip
39+
wget https://github.com/vlang/v/releases/download/$tag/v_macos_x86_64.zip
40+
unzip v_macos_x86_64.zip
4141
cd v
4242
./v -version
4343
- name: Test V
4444
run: |
4545
cd v
4646
./v run examples/hello_world.v
4747
48+
# NOTE: we cannot currently test the macos arm64 build without a apple silicon runner
49+
# the arm64 release is cross compiled from intel. the apple silicon hosted runner is
50+
# only currently available on the macos-latest-xlarge plan, not on the free plans.
51+
4852
windows:
4953
runs-on: windows-latest
5054
timeout-minutes: 5

0 commit comments

Comments
 (0)