Skip to content

Commit 73897b0

Browse files
authored
Build ARM64 MacOS releases (#4397)
There is now a new zip file in each release with 'arm64' in its name, to go along with the x86_64 package.
1 parent 16c9b30 commit 73897b0

File tree

2 files changed

+31
-5
lines changed

2 files changed

+31
-5
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
if: matrix.os == 'ubuntu-latest'
7474

7575
- name: cmake (macos)
76-
run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install
76+
run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=x86_64
7777
if: matrix.os == 'macos-latest'
7878

7979
- name: cmake (win)
@@ -82,7 +82,7 @@ jobs:
8282
if: matrix.os == 'windows-latest'
8383

8484
- name: build
85-
run: cmake --build out --config Release
85+
run: cmake --build out --config Release -v
8686

8787
- name: install
8888
run: cmake --install out --config Release

.github/workflows/create_release.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ jobs:
3737
run: mkdir -p out
3838

3939
- name: cmake (macos)
40-
run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install
40+
run: |
41+
cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=x86_64
42+
cmake -S . -B out-arm64 -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out-arm64/install -DCMAKE_OSX_ARCHITECTURES=arm64
4143
if: matrix.os == 'macos-latest'
4244

4345
- name: cmake (win)
@@ -46,10 +48,14 @@ jobs:
4648
if: matrix.os == 'windows-latest'
4749

4850
- name: build
49-
run: cmake --build out --config Release --target install
51+
run: cmake --build out -v --config Release --target install
52+
53+
- name: build-arm64
54+
run: cmake --build out-arm64 -v --config Release --target install
55+
if: matrix.os == 'macos-latest'
5056

5157
- name: strip
52-
run: find out/install/ -type f -perm -u=x -exec strip -x {} +
58+
run: find out*/install/ -type f -perm -u=x -exec strip -x {} +
5359
if: matrix.os != 'windows-latest'
5460

5561
- name: archive
@@ -60,20 +66,40 @@ jobs:
6066
PKGNAME="binaryen-$VERSION-x86_64-$OSNAME"
6167
TARBALL=$PKGNAME.tar.gz
6268
SHASUM=$PKGNAME.tar.gz.sha256
69+
rm -rf binaryen-$VERSION
6370
mv out/install binaryen-$VERSION
6471
tar -czf $TARBALL binaryen-$VERSION
6572
# on Windows, MSYS2 will strip the carriage return from CMake output
6673
cmake -E sha256sum $TARBALL > $SHASUM
6774
echo "::set-output name=tarball::$TARBALL"
6875
echo "::set-output name=shasum::$SHASUM"
6976
77+
- name: archive-arm64
78+
id: archive-arm64
79+
run: |
80+
OSNAME=$(echo ${{ matrix.os }} | sed 's/-latest//')
81+
VERSION=$GITHUB_REF_NAME
82+
PKGNAME="binaryen-$VERSION-arm64-$OSNAME"
83+
TARBALL=$PKGNAME.tar.gz
84+
SHASUM=$PKGNAME.tar.gz.sha256
85+
rm -rf binaryen-$VERSION
86+
mv out-arm64/install binaryen-$VERSION
87+
tar -czf $TARBALL binaryen-$VERSION
88+
# on Windows, MSYS2 will strip the carriage return from CMake output
89+
cmake -E sha256sum $TARBALL > $SHASUM
90+
echo "::set-output name=tarball::$TARBALL"
91+
echo "::set-output name=shasum::$SHASUM"
92+
if: matrix.os == 'macos-latest'
93+
7094
- name: upload tarball
7195
uses: softprops/action-gh-release@v1
7296
with:
7397
draft: true
7498
files: |
7599
${{ steps.archive.outputs.tarball }}
76100
${{ steps.archive.outputs.shasum }}
101+
${{ steps.archive-arm64.outputs.tarball }}
102+
${{ steps.archive-arm64.outputs.shasum }}
77103
78104
# Build with gcc 6.3 and run tests on Alpine Linux (inside chroot).
79105
# Note: Alpine uses musl libc.

0 commit comments

Comments
 (0)