diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db61b7a..e2772ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,6 +68,8 @@ jobs: - name: Setup Rust if: matrix.project.name == 'rust' uses: dtolnay/rust-toolchain@stable + with: + target: x86_64-apple-darwin,aarch64-apple-darwin - name: Build shell: bash diff --git a/rustast/build.sh b/rustast/build.sh index f8bf394..1ef72f9 100755 --- a/rustast/build.sh +++ b/rustast/build.sh @@ -6,19 +6,12 @@ ARCH=$(uname -m) echo "Building on $OS for $ARCH" -if [ "$OS" = "darwin" ]; then - if [ "$ARCH" = "arm64" ]; then - cargo build --release - cp target/release/librustast.dylib ./librustast-arm64.dylib - - elif [ "$ARCH" = "x86_64" ]; then - cargo build --release - cp target/release/librustast.dylib ./librustast-amd64.dylib - - else - echo "Unsupported macOS architecture: $ARCH" - exit 1 - fi +if [ "$OS" = "darwin" ]; then + cargo build --release --target aarch64-apple-darwin + cargo build --release --target x86_64-apple-darwin + + cp target/aarch64-apple-darwin/release/librustast.dylib ./librustast-arm64.dylib + cp target/x86_64-apple-darwin/release/librustast.dylib ./librustast-amd64.dylib elif [ "$OS" = "linux" ]; then if [ "$ARCH" = "aarch64" ]; then