forked from router-for-me/EasyCLIProxyAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·38 lines (31 loc) · 1.12 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·38 lines (31 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT_DIR"
BUILD_JOBS="${CARGO_BUILD_JOBS:-20}"
GITCODE_GUI_REPOSITORY="${GITCODE_GUI_REPOSITORY:-lzt404/EasyCLIProxyAPI}"
GITCODE_CORE_REPOSITORY="${GITCODE_CORE_REPOSITORY:-lzt404/CLIProxyAPI}"
APP_BIN="$ROOT_DIR/src-tauri/target/release/cpa-gui"
BIN_DIR="$ROOT_DIR/bin-work"
BIN_OUT="$BIN_DIR/EasyCLIProxyAPI"
if ! command -v bun >/dev/null 2>&1; then
echo "bun is not installed or not in PATH."
exit 1
fi
echo "Cargo build jobs: $BUILD_JOBS"
echo "GitCode GUI fallback repository: $GITCODE_GUI_REPOSITORY"
echo "GitCode core fallback repository: $GITCODE_CORE_REPOSITORY"
bun install
CARGO_BUILD_JOBS="$BUILD_JOBS" GITCODE_GUI_REPOSITORY="$GITCODE_GUI_REPOSITORY" GITCODE_CORE_REPOSITORY="$GITCODE_CORE_REPOSITORY" bun tauri build --no-bundle
if [ ! -x "$APP_BIN" ]; then
echo "Build finished, but executable not found: $APP_BIN"
exit 1
fi
mkdir -p "$BIN_DIR"
bun "$ROOT_DIR/scripts/portable.mjs" \
--binary "$APP_BIN" \
--output "$BIN_DIR" \
--download true
chmod +x "$BIN_OUT"
echo "Built: $APP_BIN"
echo "Copied: $BIN_OUT"