-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sh
executable file
·44 lines (37 loc) · 1.14 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
# cross_compiles
make -f ./Makefile.cross-compiles
rm -rf ./release/packages
mkdir -p ./release/packages
os_all='linux windows darwin'
arch_all='amd64 arm64'
cd ./release
for os in $os_all; do
for arch in $arch_all; do
hello_dir_name="easycar_${os}_${arch}"
hello_path="./packages/easycar_${os}_${arch}"
if [ "x${os}" = x"windows" ]; then
if [ ! -f "./easycar_${os}_${arch}.exe" ]; then
continue
fi
mkdir ${hello_path}
mv ./easycar_${os}_${arch}.exe ${hello_path}/easycar.exe
else
if [ ! -f "./easycar_${os}_${arch}" ]; then
continue
fi
mkdir ${hello_path}
mv ./easycar_${os}_${arch} ${hello_path}/easycar
fi
cp ../LICENSE ${hello_path}
cp ../conf.example.yml ${hello_path}/conf.yml
# packages
cd ./packages
if [ "x${os}" = x"windows" ]; then
zip -rq ${hello_dir_name}.zip ${hello_dir_name}
else
tar -zcf ${hello_dir_name}.tar.gz ${hello_dir_name}
fi
cd ..
rm -rf ${hello_path}
done
done