-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·54 lines (39 loc) · 1.32 KB
/
build.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
URL="https://platerates.com/latestVersion"
response=$(curl -s -X GET -d "" "$URL")
clientVer=$(yq -r '.version' 'pubspec.yaml')
echo ""
echo "make sure verison has been updated and changes have been added to changelog"
echo "current server running $response"
echo "new client running $clientVer"
read -p "does this look correct? (kill if wrong): " correct
if [ "$response" == "$clientVer" ]
then
echo "please update verison or build to push update"
exit 1
fi
set -e
#already know start dir
echo " # building web"
flutter build web --release
echo "done"
/bin/sleep 2
echo " # building apk"
flutter build apk --release
echo "done"
/bin/sleep 2
cd .server
cargo build --release
echo "done"
echo " # injecting builds"
rm -R build/
mkdir -p build/
mkdir -p build/static_data/
cd ..
#after build finished bring over files for web and what not
#only done now and wihtout sys link as not wanted to be included in typescript
cp .server/target/release/platerates_server ./.server/build/platerates_server
cp .server/static_data/jwt.key ./.server/build/static_data/jwt.key
cp .server/static_data/firebase.json ./.server/build/static_data/firebase.json
cp -R ./build/web ./.server/build/static_data/web/
cp ./build/app/outputs/flutter-apk/app-release.apk ./.server/build/static_data/web/Platerates.apk
echo "all finished can now be used"