-
Notifications
You must be signed in to change notification settings - Fork 4
/
package.sh
executable file
·63 lines (54 loc) · 1.66 KB
/
package.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
59
60
61
62
63
# compile for version
make
if [ $? -ne 0 ]; then
echo "make error"
exit 1
fi
tool_version=`./bin/server --version`
echo "build version: $tool_version"
# cross_compiles
make -f ./Makefile.cross-compiles
rm -rf ./release/packages
mkdir -p ./release/packages
os_all='linux windows darwin freebsd'
arch_all='386 amd64 arm arm64 mips64 mips64le mips mipsle riscv64'
cd ./release
for os in $os_all; do
for arch in $arch_all; do
tool_dir_name="tool_${tool_version}_${os}_${arch}"
tool_path="./packages/tool_${tool_version}_${os}_${arch}"
if [ "x${os}" = x"windows" ]; then
if [ ! -f "./client_${os}_${arch}.exe" ]; then
continue
fi
if [ ! -f "./server_${os}_${arch}.exe" ]; then
continue
fi
mkdir ${tool_path}
mv ./client_${os}_${arch}.exe ${tool_path}/client.exe
mv ./server_${os}_${arch}.exe ${tool_path}/server.exe
else
if [ ! -f "./client_${os}_${arch}" ]; then
continue
fi
if [ ! -f "./server_${os}_${arch}" ]; then
continue
fi
mkdir ${tool_path}
mv ./client_${os}_${arch} ${tool_path}/client
mv ./server_${os}_${arch} ${tool_path}/server
fi
cp ../LICENSE ${tool_path}
cp -rf ../conf/* ${tool_path}
# packages
cd ./packages
if [ "x${os}" = x"windows" ]; then
zip -rq ${tool_dir_name}.zip ${tool_dir_name}
else
tar -zcf ${tool_dir_name}.tar.gz ${tool_dir_name}
fi
cd ..
rm -rf ${tool_path}
done
done
cd -