From d6d24dcac047e98fac2d429318e00adf1feaebda Mon Sep 17 00:00:00 2001 From: Talal Ashraf Date: Thu, 30 May 2024 16:46:19 -0400 Subject: [PATCH] chore: add macos build --- .../build-docker-image-and-binaries.yaml | 24 ++++++++++++++++++- install-gmp-arm64.sh | 6 +++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 install-gmp-arm64.sh diff --git a/.github/workflows/build-docker-image-and-binaries.yaml b/.github/workflows/build-docker-image-and-binaries.yaml index 8c6d023b..eaa4648d 100644 --- a/.github/workflows/build-docker-image-and-binaries.yaml +++ b/.github/workflows/build-docker-image-and-binaries.yaml @@ -63,6 +63,28 @@ jobs: TOFND_PATH="/Users/runner/work/tofnd/tofnd/target/release" fi + - name: build darwin binaries + env: + SEMVER: ${{ github.event.inputs.tag }} + if: matrix.os == 'macos-latest' + run: | + OS="darwin" + ARCH="${{ matrix.arch }}" + if [ "$ARCH" == "arm64" ] + then + export HOMEBREW_NO_INSTALL_CLEANUP=TRUE + brew uninstall --ignore-dependencies gmp + ARM_DEPENDENCY=$(brew fetch --force --bottle-tag=arm64_big_sur gmp | grep Downloaded | awk '{print $3}') + brew install "$ARM_DEPENDENCY" + rustup target add aarch64-apple-darwin + cargo build --release --target aarch64-apple-darwin + mkdir -p tofndbin + mv /Users/runner/work/tofnd/tofnd/target/aarch64-apple-darwin/release/tofnd "./tofndbin/tofnd-$OS-$ARCH-$SEMVER" + else + cargo install --locked --path . + mkdir -p tofndbin + mv "/Users/runner/work/tofnd/tofnd/target/release/tofnd" "./tofndbin/tofnd-$OS-$ARCH-$SEMVER" + fi - name: build linux binaries env: SEMVER: ${{ github.event.inputs.tag }} @@ -71,7 +93,7 @@ jobs: OS="linux" ARCH="${{ matrix.arch }}" cargo install --locked --path . - mkdir tofndbin + mkdir -p tofndbin mv "$TOFND_PATH/tofnd" "./tofndbin/tofnd-$OS-$ARCH-$SEMVER" - name: Test tofnd version diff --git a/install-gmp-arm64.sh b/install-gmp-arm64.sh new file mode 100755 index 00000000..8e80edb3 --- /dev/null +++ b/install-gmp-arm64.sh @@ -0,0 +1,6 @@ +#! /bin/bash + +export HOMEBREW_NO_INSTALL_CLEANUP=TRUE +brew uninstall --ignore-dependencies gmp +ARM_DEPENDENCY=$(brew fetch --force --bottle-tag=arm64_big_sur gmp | grep Downloaded | awk '{print $3}') +brew install "$ARM_DEPENDENCY"