This repository has been archived by the owner on Aug 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
release.sh
58 lines (47 loc) · 1.54 KB
/
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
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
echo='echo -e \n '
echo "---- Make sure that you're running this script from the project root ----"
$echo "---- Performing version bump (leave empty to skip) ----"
read -p "From version: " old_version
read -p "To version: " new_version
sed -i "0,/version = \"$old_version\"/{s/$old_version/$new_version/}" ./mapper_service/Cargo.toml
sed -i "0,/version = \"$old_version\"/{s/$old_version/$new_version/}" ./ui/src-tauri/Cargo.toml
sed -i "0,/\"version\": \"$old_version\"/{s/$old_version/$new_version/}" ./ui/src-tauri/tauri.conf.json
$echo "---- Cleaning previous build ----"
rm -rf release_build
mkdir release_build
mkdir ./release_build/mapper_service
$echo "---- Installing build dependencies ----"
declare -a supported_targets=(
"x86_64-pc-windows-msvc"
)
for target in "${supported_targets[@]}"
do
rustup target add $target
done
$echo "---- Compiling mapper service ----"
cd ./mapper_service
for target in "${supported_targets[@]}"
do
rm -rf target
cargo clean
SHOULD_ATTACH_MANIFEST=true cargo build --release --target $target
# Windows
cp ./target/$target/release/mapper_service.exe ../release_build/mapper_service/mapper_service-$target.exe
done
$echo "---- Cleaning UI----"
cd ../ui
rm -rf node_modules
npm i
cd ./src-tauri
rm -rf target
cargo clean
cp ../../LICENSE .
cp ../../start-on-boot.bat .
cd ..
$echo "---- Compiling UI ----"
npm run tauri build
find ./src-tauri/target/release/bundle -type f -exec cp {} ../release_build/ \;
cd ..
cp ./LICENSE ./release_build/
$echo "---- Done (see release_build) ----"