From ead0c59ed5b659fc2f8f21b97a767655e67adb38 Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 25 Oct 2025 10:55:25 +0100 Subject: [PATCH 1/2] Add macos arm builds to release.yml --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f76fc0da..3024ab03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,8 @@ env: RELEASE_DIR: artifacts GITHUB_REF: '${{ github.ref }}' WINDOWS_TARGET: x86_64-pc-windows-msvc - MACOS_TARGET: x86_64-apple-darwin + MACOS_AMD64_TARGET: x86_64-apple-darwin + MACOS_ARM64_TARGET: aarch64-apple-darwin LINUX_AMD64_TARGET: x86_64-unknown-linux-musl LINUX_ARM64_TARGET: aarch64-unknown-linux-musl @@ -30,6 +31,9 @@ jobs: - target: aarch64-unknown-linux-musl os: ubuntu-latest rust: stable + - target: aarch64-apple-darwin + os: macos-latest + rust: stable - target: x86_64-apple-darwin os: macos-latest rust: stable @@ -141,10 +145,15 @@ jobs: with: name: ${{ env.WINDOWS_TARGET }} - - name: Download MacOS tarball + - name: Download MacOS amd64 tarball uses: actions/download-artifact@v4.1.7 with: - name: ${{ env.MACOS_TARGET }} + name: ${{ env.MACOS_AMD64_TARGET }} + + - name: Download MacOS arm64 tarball + uses: actions/download-artifact@v4.1.7 + with: + name: ${{ env.MACOS_ARM64_TARGET }} - name: Release Linux amd64 tarball uses: actions/upload-release-asset@v1 @@ -186,12 +195,22 @@ jobs: asset_content_type: application/vnd.microsoft.portable-executable asset_name: wasm-pack-init.exe - - name: Release MacOS tarball + - name: Release MacOS amd64 tarball + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./wasm-pack-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_AMD64_TARGET }}.tar.gz + asset_content_type: application/gzip + asset_name: wasm-pack-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_AMD64_TARGET }}.tar.gz + + - name: Release MacOS arm64 tarball uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./wasm-pack-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_TARGET }}.tar.gz + asset_path: ./wasm-pack-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_ARM64_TARGET }}.tar.gz asset_content_type: application/gzip - asset_name: wasm-pack-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_TARGET }}.tar.gz + asset_name: wasm-pack-${{ steps.get_version.outputs.VERSION }}-${{ env.MACOS_ARM64_TARGET }}.tar.gz From 11f466dbf86e933acb3a82937556cb767f2b98ee Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 25 Oct 2025 10:57:34 +0100 Subject: [PATCH 2/2] Add branch for `aarch64-apple-darwin` in NPM install script --- npm/binary.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/npm/binary.js b/npm/binary.js index f91bdbd2..544a2e15 100644 --- a/npm/binary.js +++ b/npm/binary.js @@ -18,9 +18,12 @@ const getPlatform = () => { if (type === "Linux" && arch === "arm64") { return "aarch64-unknown-linux-musl"; } - if (type === "Darwin" && (arch === "x64" || arch === "arm64")) { + if (type === "Darwin" && arch === "x64") { return "x86_64-apple-darwin"; } + if (type === "Darwin" && arch === "arm64") { + return "aarch64-apple-darwin"; + } throw new Error(`Unsupported platform: ${type} ${arch}`); };