Files
RustBox/scripts/build-release.sh
Mateusz Gruszczyński fff8521a17
RustBox CI / rustbox (push) Waiting to run
v0.0.2
2026-10-29 19:28:47 +01:00

29 lines
692 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
if ! command -v cargo >/dev/null 2>&1; then
echo "error: Rust/Cargo is required" >&2
exit 1
fi
if find "$ROOT" -type f \( -name '*.ts' -o -name '*.tsx' \) -print -quit | grep -q .; then
echo "error: TypeScript source found in RustBox" >&2
exit 1
fi
if [[ -e "$ROOT/src/web/app.js" || ! -f "$ROOT/src/web/js/manifest.txt" ]]; then
echo "error: browser JavaScript must be modularized under src/web/js/" >&2
exit 1
fi
cargo test --locked
cargo build --release --locked
BIN="$ROOT/target/release/rustbox"
test -x "$BIN"
"$BIN" --version
printf 'Built RustBox: %s\n' "$BIN"