-
Notifications
You must be signed in to change notification settings - Fork 3
/
packages.sh
executable file
·64 lines (54 loc) · 1.8 KB
/
packages.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
64
# compile for version
make
if [ $? -ne 0 ]; then
echo "make error"
exit 1
fi
easy_admin_version=`./easy-admin version`
echo "build version: $easy_admin_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
easy_admin_dir_name="easy-admin_${easy_admin_version}_${os}_${arch}"
easy_admin_path="./packages/easy-admin_${easy_admin_version}_${os}_${arch}"
if [ "x${os}" = x"windows" ]; then
if [ ! -f "./easy-admin_${os}_${arch}.exe" ]; then
continue
fi
if [ ! -f "./easy-admin_${os}_${arch}.exe" ]; then
continue
fi
mkdir ${easy_admin_path}
mv ./easy-admin_${os}_${arch}.exe ${easy_admin_path}/easy-admin.exe
else
if [ ! -f "./easy-admin_${os}_${arch}" ]; then
continue
fi
mkdir ${easy_admin_path}
mv ./easy-admin_${os}_${arch} ${easy_admin_path}/easy-admin
fi
cp ../LICENSE ${easy_admin_path}
cp -rf ../config/*.sql ${easy_admin_path}
cp -rf ../README.md ${easy_admin_path}
cp -rf ../config/settings.yml ${easy_admin_path}
cp -rf ../config/settings.full.yml ${easy_admin_path}
rm -rf ${easy_admin_path}/legacy
# packages
cd ./packages
if [ "x${os}" = x"windows" ]; then
zip -rq ${easy_admin_dir_name}.zip ${easy_admin_dir_name}
else
tar -zcf ${easy_admin_dir_name}.tar.gz ${easy_admin_dir_name}
fi
cd ..
rm -rf ${easy_admin_path}
done
done
cd -
echo "Done"