-
Notifications
You must be signed in to change notification settings - Fork 142
/
build.sh
executable file
·47 lines (42 loc) · 1.17 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
rm -rf ./releases/*
mkdir -p releases
cd web
npm run build
cd ../
# build for mac
cd server
GOOS=darwin GOARCH=amd64 go build
cd ../releases
mkdir gshark_darwin_amd64
cd gshark_darwin_amd64
mv ../../server/gshark .
cp -rf ../../server/resource .
cp ../../server/config-temp.yaml config.yaml
cd ../../
cp -rf ./web/dist ./releases/gshark_darwin_amd64
7z a -r ./releases/gshark_darwin_amd64.zip ./releases/gshark_darwin_amd64/
# build for windows
cd server
GOOS=windows GOARCH=amd64 go build
cd ../releases
mkdir gshark_windows_amd64
cd gshark_windows_amd64
mv ../../server/gshark.exe .
cp -rf ../../server/resource .
cp ../../server/config-temp.yaml config.yaml
cd ../../
cp -rf ./web/dist ./releases/gshark_windows_amd64
7z a -r ./releases/gshark_windows_amd64.zip ./releases/gshark_windows_amd64/
# build for linux
cd server
GOOS=linux GOARCH=amd64 go build -o gshark
cd ../releases
mkdir gshark_linux_amd64
cd gshark_linux_amd64
mv ../../server/gshark .
cp -rf ../../server/resource .
cp ../../server/config-temp.yaml config.yaml
cd ../../
cp -rf ./web/dist ./releases/gshark_linux_amd64
7z a -r ./releases/gshark_linux_amd64.zip ./releases/gshark_linux_amd64
rm -rf ./releases/gshark*/