-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sh
46 lines (37 loc) · 866 Bytes
/
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
#!/bin/sh
version=v0.0.1
cd target
function build_tar_gz()
{
echo "build on $GOOS-$GOARCH ..."
go build ../gohomekit.go
echo "tar package ..."
tar zcvf "./gohomekit-$version-$GOOS-$GOARCH.tar.gz" ./conf ./gohomekit
rm -f ./gohomekit
}
function build_zip()
{
echo "build on $GOOS-$GOARCH ..."
go build ../gohomekit.go
echo "zip package ..."
if [ "$GOOS" == "windows" ];then
zip "./gohomekit-$version-$GOOS-$GOARCH.zip" ./conf ./gohomekit.exe
rm -f ./gohomekit.exe
else
zip "./gohomekit-$version-$GOOS-$GOARCH.zip" ./conf ./gohomekit
rm -f ./gohomekit
fi
}
export CGO_ENABLED=0
export GOOS=linux
export GOARCH=arm
build_tar_gz
export GOARCH=amd64
build_tar_gz
export GOOS=darwin
export GOARCH=amd64
build_tar_gz
export GOOS=windows
export GOARCH=386
build_zip
echo "over!!!"