Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(infra): mac-os builds fail, solve by porting some changes from main #327

Merged
merged 6 commits into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions .github/workflows/build-docker-image-and-binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,45 @@ jobs:
TOFND_PATH="/Users/runner/work/tofnd/tofnd/target/release"
fi

- name: build linux binaries
- name: Build Mac OS binaries
env:
SEMVER: ${{ github.event.inputs.tag }}
if: matrix.os == 'macos-latest'
run: |
OS="darwin"
ARCH="${{ matrix.arch }}"

export LIBRARY_PATH=/opt/homebrew/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=/opt/homebrew/lib:$LD_LIBRARY_PATH

mkdir -p tofndbin

if [ "$ARCH" == "arm64" ]
then
talalashraf marked this conversation as resolved.
Show resolved Hide resolved
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
mv /Users/runner/work/tofnd/tofnd/target/aarch64-apple-darwin/release/tofnd "./tofndbin/tofnd-$OS-$ARCH-$SEMVER"
else
cargo install --locked --path .
mv "/Users/runner/work/tofnd/tofnd/target/release/tofnd" "./tofndbin/tofnd-$OS-$ARCH-$SEMVER"
talalashraf marked this conversation as resolved.
Show resolved Hide resolved
fi
- name: Build Linux binaries
env:
SEMVER: ${{ github.event.inputs.tag }}
if: matrix.os == 'ubuntu-latest'
run: |
OS="linux"
ARCH="${{ matrix.arch }}"
cargo install --locked --path .
mkdir tofndbin
mv "$TOFND_PATH/tofnd" "./tofndbin/tofnd-$OS-$ARCH-$SEMVER"
mkdir -p tofndbin
mv "/home/runner/.cargo/bin/tofnd" "./tofndbin/tofnd-$OS-$ARCH-$SEMVER"

- name: Test tofnd version
working-directory: ./tofndbin
Expand Down
Loading