-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·63 lines (53 loc) · 1.93 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·63 lines (53 loc) · 1.93 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# OpenSecAI Production Build Script
# Combines Python sidecar compilation (PyInstaller) and Tauri desktop application packaging.
set -e
# Resolve script directory to allow running from any CWD
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$REPO_ROOT"
# Force ENV to prod for production packaging
export ENV=prod
echo "=================================================="
echo " Starting OpenSecAI Production Build Pipeline"
echo "=================================================="
# 1. Sync Python dependencies
echo ""
echo "--- Step 1: Syncing Python dependencies via uv ---"
if command -v uv &> /dev/null; then
uv sync
else
echo "Error: 'uv' is not installed or not in PATH. Please run setup.sh first."
exit 1
fi
# 2. Compile Python FastAPI Sidecar using PyInstaller
echo ""
echo "--- Step 2: Compiling Python FastAPI sidecar ---"
uv run pyinstaller --clean --onefile --name opensecai-api \
--collect-all opensecai \
--collect-all uvicorn \
--collect-all fastapi \
--collect-all langgraph \
--collect-all langchain \
opensecai/api/__main__.py
# 3. Copy compiled sidecar to Tauri source directory
echo ""
echo "--- Step 3: Copying sidecar executable to Tauri folder ---"
mkdir -p desktop/src-tauri
cp dist/opensecai-api desktop/src-tauri/opensecai-api
echo "Successfully copied sidecar to desktop/src-tauri/opensecai-api"
# 4. Install Frontend Dependencies
echo ""
echo "--- Step 4: Installing frontend Node modules ---"
cd desktop
npm install
# 5. Build Tauri Desktop Application Bundle
echo ""
echo "--- Step 5: Packaging Tauri production build ---"
npm run tauri build
echo ""
echo "=================================================="
echo " OpenSecAI Production Build Completed Successfully!"
echo "=================================================="
echo "Bundled packages are available in:"
echo " $REPO_ROOT/desktop/src-tauri/target/release/bundle/"
echo "=================================================="