forked from vzex/dog-tunnel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·37 lines (36 loc) · 1.01 KB
/
release.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
#!/bin/bash
version=$1
if [ $# -eq 0 ]
then
echo "Please input version, like \"./release.sh 0.60\""
exit
fi
rm -f dtunnel_*$1.tgz
echo "Build ReleaseFile for version $version"
cd $GOROOT/src
GOOS=linux GOARCH=amd64 bash ./make.bash
cd -
echo "build linux_amd64"
GOOS=linux GOARCH=amd64 make
tar zcvf dtunnel_linux_x64_$1.tgz dtunnel dtunnel_s
echo "build linux_386"
GOOS=linux GOARCH=386 make
tar zcvf dtunnel_linux_x86_$1.tgz dtunnel dtunnel_s
echo "build mac_x64"
GOOS=darwin GOARCH=amd64 make
tar zcvf dtunnel_mac_x64_$1.tgz dtunnel dtunnel_s
cd $GOROOT/src
GOOS=windows GOARCH=386 bash ./make.bash
cd -
echo "build win32"
GOOS=windows GOARCH=386 make && mv dtunnel dtunnel.exe && mv dtunnel_s dtunnel_s.exe
tar zcvf dtunnel_win32_$1.tgz dtunnel.exe dtunnel_s.exe
cd $GOROOT/src
GOOS=linux GOARCH=arm bash ./make.bash
cd -
echo "build linux_arm"
GOOS=linux GOARCH=arm make
tar zcvf dtunnel_linux_arm_$1.tgz dtunnel dtunnel_s
rm -f dtunnel dtunnel.exe dtunnel_s dtunnel_s.exe
echo "Build Over"
ls -l dtunnel_*$1.tgz