-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_release.sh
48 lines (36 loc) · 1.33 KB
/
build_release.sh
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
#!/bin/bash
set -e
chmod +x build_release.sh
mkdir -p release/installer
mkdir -p release/wasm
mkdir -p release/wasi
echo "Building native targets..."
echo "Building Windows target..."
cross build --release --target x86_64-pc-windows-gnu --features native || {
echo "Windows build failed but continuing..."
}
echo "Building Linux target..."
cross build --release --target x86_64-unknown-linux-gnu --features native || {
echo "Linux build failed but continuing..."
}
echo "Building WASM target..."
if command -v wasm-pack >/dev/null 2>&1; then
wasm-pack build --target web --release -- --features wasm
cp pkg/* release/wasm/
else
echo "wasm-pack not found, skipping WASM build"
fi
echo "Building WASI target..."
rustup target add wasm32-wasip1
cargo build --release --target wasm32-wasip1 --features wasi
cp target/wasm32-wasip1/release/fplc.wasm release/wasi/
echo "Copying binaries to release folder..."
if [ -f "target/x86_64-pc-windows-gnu/release/fplc.exe" ]; then
cp target/x86_64-pc-windows-gnu/release/fplc.exe release/fplc-x64.exe
cp release/fplc-x64.exe installer/fplc.exe
fi
if [ -f "target/x86_64-unknown-linux-gnu/release/fplc" ]; then
cp target/x86_64-unknown-linux-gnu/release/fplc release/fplc-linux-x64
chmod +x release/fplc-linux-x64
fi
echo "Build complete! Binaries are in the release folder."