Elffuss BraidHub

kikocis/lancedb public

main · 788 BRawPermalink
1# Builds the macOS artifacts (node binaries).
2# Usage: ./ci/build_macos_artifacts.sh [target]
3# Targets supported: x86_64-apple-darwin aarch64-apple-darwin
4set -e
5
6prebuild_rust() {
7 # Building here for the sake of easier debugging.
8 pushd rust/ffi/node
9 echo "Building rust library for $1"
10 export RUST_BACKTRACE=1
11 cargo build --release --target $1
12 popd
13}
14
15build_node_binaries() {
16 pushd node
17 echo "Building node library for $1"
18 npm run build-release -- --target $1
19 npm run pack-build -- --target $1
20 popd
21}
22
23if [ -n "$1" ]; then
24 targets=$1
25else
26 targets="x86_64-apple-darwin aarch64-apple-darwin"
27fi
28
29echo "Building artifacts for targets: $targets"
30for target in $targets
31 do
32 prebuild_rust $target
33 build_node_binaries $target
34done