mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Signed-off-by: Will Pfleger <pfleger.will@gmail.com> Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
50 lines
1.8 KiB
Bash
Executable File
50 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SIDECARS=(buzz-acp buzz-agent buzz-dev-mcp git-credential-nostr buzz)
|
|
HOST=$(rustc -vV | sed -n 's|host: ||p')
|
|
TARGET=${1:-$HOST}
|
|
BINARIES_DIR="desktop/src-tauri/binaries"
|
|
|
|
# When --target is passed explicitly to cargo (even if it matches the host),
|
|
# binaries land in target/<triple>/release/. Without --target, they land in
|
|
# target/release/. The script receives the target as $1 only when cargo was
|
|
# invoked with --target, so use the qualified path whenever $1 is set.
|
|
if [[ -n "${1:-}" ]]; then
|
|
SRC_DIR="target/${TARGET}/release"
|
|
else
|
|
SRC_DIR="target/release"
|
|
fi
|
|
|
|
# MSVC emits <name>.exe; Tauri's externalBin then expects binaries/<name>-<triple>.exe.
|
|
if [[ "$TARGET" == *windows* ]]; then
|
|
EXE=".exe"
|
|
else
|
|
EXE=""
|
|
fi
|
|
|
|
missing=()
|
|
for bin in "${SIDECARS[@]}"; do
|
|
[[ -f "$SRC_DIR/${bin}${EXE}" ]] || missing+=("${bin}${EXE}")
|
|
done
|
|
if [[ ${#missing[@]} -gt 0 ]]; then
|
|
echo "Error: missing release binaries in $SRC_DIR: ${missing[*]}" >&2
|
|
echo "Run 'cargo build --release -p buzz-acp -p buzz-agent -p buzz-dev-mcp -p git-credential-nostr -p buzz-cli' first." >&2
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p "$BINARIES_DIR"
|
|
for bin in "${SIDECARS[@]}"; do
|
|
cp "$SRC_DIR/${bin}${EXE}" "$BINARIES_DIR/${bin}-${TARGET}${EXE}"
|
|
done
|
|
echo "Sidecars bundled for $TARGET"
|
|
|
|
# Windows-only: stage a genuine, non-WSL bash plus the full git toolchain next to
|
|
# the sidecars so the MCP shell tool works on a bare host. The download/extract
|
|
# logic lives in a self-contained script (no release-binary precondition) so CI can
|
|
# call it directly to exercise this path on a real Windows runner — see
|
|
# scripts/stage-windows-bash.sh for the full rationale and the PATH CONTRACT.
|
|
if [[ "$TARGET" == *windows* ]]; then
|
|
"$(dirname "$0")/stage-windows-bash.sh" "$BINARIES_DIR/git-bash"
|
|
fi
|