-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlocal-build.sh
More file actions
executable file
·82 lines (68 loc) · 1.98 KB
/
Copy pathlocal-build.sh
File metadata and controls
executable file
·82 lines (68 loc) · 1.98 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
set -e # Exit on any error
# Detect OS and architecture
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
# Map architecture names
case "$ARCH" in
x86_64)
ARCH="x64"
;;
arm64|aarch64)
ARCH="arm64"
;;
*)
echo "⚠️ Warning: Unknown architecture $ARCH, using as-is"
;;
esac
# Map OS names
case "$OS" in
linux)
OS="linux"
;;
darwin)
OS="macos"
;;
*)
echo "⚠️ Warning: Unknown OS $OS, using as-is"
;;
esac
PLATFORM="${OS}-${ARCH}"
# Set CARGO_TARGET_DIR if not defined
if [ -z "$CARGO_TARGET_DIR" ]; then
CARGO_TARGET_DIR="target"
fi
echo "🔍 Detected platform: $PLATFORM"
echo "🔧 Using target directory: $CARGO_TARGET_DIR"
echo "🧹 Cleaning previous builds..."
rm -rf npx-cli/dist
mkdir -p npx-cli/dist/$PLATFORM
echo "🔨 Building frontend..."
(cd frontend && npm run build)
echo "🔨 Building Rust binaries..."
cargo build --release --manifest-path Cargo.toml
cargo build --release --bin mcp_task_server --manifest-path Cargo.toml
echo "📦 Creating distribution package..."
# Copy the main binary
cp ${CARGO_TARGET_DIR}/release/server vibe-kanban
zip -q vibe-kanban.zip vibe-kanban
rm -f vibe-kanban
mv vibe-kanban.zip npx-cli/dist/$PLATFORM/vibe-kanban.zip
# Copy the MCP binary
cp ${CARGO_TARGET_DIR}/release/mcp_task_server vibe-kanban-mcp
zip -q vibe-kanban-mcp.zip vibe-kanban-mcp
rm -f vibe-kanban-mcp
mv vibe-kanban-mcp.zip npx-cli/dist/$PLATFORM/vibe-kanban-mcp.zip
# Copy the Review CLI binary
cp ${CARGO_TARGET_DIR}/release/review vibe-kanban-review
zip -q vibe-kanban-review.zip vibe-kanban-review
rm -f vibe-kanban-review
mv vibe-kanban-review.zip npx-cli/dist/$PLATFORM/vibe-kanban-review.zip
echo "✅ Build complete!"
echo "📁 Files created:"
echo " - npx-cli/dist/$PLATFORM/vibe-kanban.zip"
echo " - npx-cli/dist/$PLATFORM/vibe-kanban-mcp.zip"
echo " - npx-cli/dist/$PLATFORM/vibe-kanban-review.zip"
echo ""
echo "🚀 To test locally, run:"
echo " cd npx-cli && node bin/cli.js"