From 39ec65fccf8d06a1c5557d2f89d5d7ab98f78c3a Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 15 Dec 2021 16:26:12 -0800 Subject: [PATCH 1/9] Try Arm64 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc762704fb8..11f4d42ba3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: if: matrix.os == 'ubuntu-latest' - name: cmake (macos) - run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install + run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=arm64 if: matrix.os == 'macos-latest' - name: cmake (win) From 821eeefea08a1dd51c02ff4a35641cfe69560afa Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 15 Dec 2021 16:31:23 -0800 Subject: [PATCH 2/9] verbose --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11f4d42ba3a..438530e746d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,7 +82,7 @@ jobs: if: matrix.os == 'windows-latest' - name: build - run: cmake --build out --config Release + run: cmake --build out --config Release -v - name: install run: cmake --install out --config Release From 62c07ca2b50d3fcccc845ec1c444aaae4cec54bc Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 15 Dec 2021 16:50:53 -0800 Subject: [PATCH 3/9] universal binaries --- .github/workflows/ci.yml | 2 +- .github/workflows/create_release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 438530e746d..79b67b3288b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: if: matrix.os == 'ubuntu-latest' - name: cmake (macos) - run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=arm64 + run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64 if: matrix.os == 'macos-latest' - name: cmake (win) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index a13ec6561c8..08174b83e74 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -40,7 +40,7 @@ jobs: run: mkdir -p out - name: cmake (macos) - run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install + run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64 if: matrix.os == 'macos-latest' - name: cmake (win) From 511b074a693b432eed5a8cf2e67e2e2c9827bb7d Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 16 Dec 2021 15:09:06 -0800 Subject: [PATCH 4/9] quote the flag --- .github/workflows/ci.yml | 2 +- .github/workflows/create_release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79b67b3288b..3205c8028c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: if: matrix.os == 'ubuntu-latest' - name: cmake (macos) - run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64 + run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install '-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64' if: matrix.os == 'macos-latest' - name: cmake (win) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 08174b83e74..b96d6942584 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -40,7 +40,7 @@ jobs: run: mkdir -p out - name: cmake (macos) - run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64 + run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install '-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64' if: matrix.os == 'macos-latest' - name: cmake (win) From 1ad2fab38f810322e9bfb03c13419343fa685fe2 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 5 Jan 2022 10:20:51 -0800 Subject: [PATCH 5/9] try separate packages --- .github/workflows/create_release.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index b96d6942584..ea1af0d909b 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -40,7 +40,8 @@ jobs: run: mkdir -p out - name: cmake (macos) - run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install '-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64' + run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=x86_64 + run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=arm64 if: matrix.os == 'macos-latest' - name: cmake (win) @@ -70,6 +71,22 @@ jobs: echo "::set-output name=tarball::$TARBALL" echo "::set-output name=shasum::$SHASUM" + - name: archive-arm64 + id: archive-arm64 + run: | + OSNAME=$(echo ${{ matrix.os }} | sed 's/-latest//') + VERSION=$GITHUB_REF_NAME + PKGNAME="binaryen-$VERSION-arm64-$OSNAME" + TARBALL=$PKGNAME.tar.gz + SHASUM=$PKGNAME.tar.gz.sha256 + mv out/install binaryen-$VERSION + tar -czf $TARBALL binaryen-$VERSION + # on Windows, MSYS2 will strip the carriage return from CMake output + cmake -E sha256sum $TARBALL > $SHASUM + echo "::set-output name=tarball::$TARBALL" + echo "::set-output name=shasum::$SHASUM" + if: matrix.os == 'macos-latest' + - name: upload tarball uses: softprops/action-gh-release@v1 with: @@ -77,6 +94,8 @@ jobs: files: | ${{ steps.archive.outputs.tarball }} ${{ steps.archive.outputs.shasum }} + ${{ steps.archive-arm64.outputs.tarball }} + ${{ steps.archive-arm64.outputs.shasum }} # Build with gcc 6.3 and run tests on Alpine Linux (inside chroot). # Note: Alpine uses musl libc. From 9409192390f1f46fdfe0ca52b00e91dafbbaf087 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 5 Jan 2022 10:36:05 -0800 Subject: [PATCH 6/9] make the CI a single-arch binary --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3205c8028c5..d9d7d8c5394 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: if: matrix.os == 'ubuntu-latest' - name: cmake (macos) - run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install '-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64' + run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=x86_64 if: matrix.os == 'macos-latest' - name: cmake (win) From 7f62f87ecee03993cc67c9e9449d2fc9f9e14621 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 5 Jan 2022 10:38:41 -0800 Subject: [PATCH 7/9] fix mac run step --- .github/workflows/create_release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index ea1af0d909b..ef1b1408b70 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -40,8 +40,9 @@ jobs: run: mkdir -p out - name: cmake (macos) - run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=x86_64 - run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=arm64 + run: | + cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=x86_64 + cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=arm64 if: matrix.os == 'macos-latest' - name: cmake (win) From 9441ee16069f5ab5cb862ab11d093c706078775c Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 5 Jan 2022 10:46:29 -0800 Subject: [PATCH 8/9] split output directory correctly --- .github/workflows/create_release.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index ef1b1408b70..4f32b289895 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -42,7 +42,7 @@ jobs: - name: cmake (macos) run: | cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=x86_64 - cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_OSX_ARCHITECTURES=arm64 + cmake -S . -B out-arm64 -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out-arm64/install -DCMAKE_OSX_ARCHITECTURES=arm64 if: matrix.os == 'macos-latest' - name: cmake (win) @@ -53,8 +53,12 @@ jobs: - name: build run: cmake --build out --config Release --target install + - name: build-arm64 + run: cmake --build out-arm64 --config Release --target install + if: matrix.os == 'macos-latest' + - name: strip - run: find out/install/ -type f -perm -u=x -exec strip -x {} + + run: find out*/install/ -type f -perm -u=x -exec strip -x {} + if: matrix.os != 'windows-latest' - name: archive @@ -80,7 +84,7 @@ jobs: PKGNAME="binaryen-$VERSION-arm64-$OSNAME" TARBALL=$PKGNAME.tar.gz SHASUM=$PKGNAME.tar.gz.sha256 - mv out/install binaryen-$VERSION + mv out-arm64/install binaryen-$VERSION tar -czf $TARBALL binaryen-$VERSION # on Windows, MSYS2 will strip the carriage return from CMake output cmake -E sha256sum $TARBALL > $SHASUM From da4cf35628fae7030a87895620e4e9b1860df736 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 5 Jan 2022 11:28:51 -0800 Subject: [PATCH 9/9] clear output dir before moving --- .github/workflows/create_release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 4f32b289895..051cbcd6f9a 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -51,10 +51,10 @@ jobs: if: matrix.os == 'windows-latest' - name: build - run: cmake --build out --config Release --target install + run: cmake --build out -v --config Release --target install - name: build-arm64 - run: cmake --build out-arm64 --config Release --target install + run: cmake --build out-arm64 -v --config Release --target install if: matrix.os == 'macos-latest' - name: strip @@ -69,6 +69,7 @@ jobs: PKGNAME="binaryen-$VERSION-x86_64-$OSNAME" TARBALL=$PKGNAME.tar.gz SHASUM=$PKGNAME.tar.gz.sha256 + rm -rf binaryen-$VERSION mv out/install binaryen-$VERSION tar -czf $TARBALL binaryen-$VERSION # on Windows, MSYS2 will strip the carriage return from CMake output @@ -84,6 +85,7 @@ jobs: PKGNAME="binaryen-$VERSION-arm64-$OSNAME" TARBALL=$PKGNAME.tar.gz SHASUM=$PKGNAME.tar.gz.sha256 + rm -rf binaryen-$VERSION mv out-arm64/install binaryen-$VERSION tar -czf $TARBALL binaryen-$VERSION # on Windows, MSYS2 will strip the carriage return from CMake output