From b8e3b99a6aafcc8311bfb01ef27f028d17bf8de3 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 | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-image-and-binaries.yaml b/.github/workflows/build-docker-image-and-binaries.yaml index 8c6d023b..e7069b2c 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_sonoma 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,8 +93,8 @@ jobs: OS="linux" ARCH="${{ matrix.arch }}" cargo install --locked --path . - mkdir tofndbin - mv "$TOFND_PATH/tofnd" "./tofndbin/tofnd-$OS-$ARCH-$SEMVER" + mkdir -p tofndbin + mv "/Users/runner/work/tofnd/tofnd/target/release/tofnd" "./tofndbin/tofnd-$OS-$ARCH-$SEMVER" - name: Test tofnd version working-directory: ./tofndbin