package tool

This commit is contained in:
Liang Ding 2014-11-03 22:07:04 +08:00
parent 957a909512
commit 5d8c8e5d3a
2 changed files with 53 additions and 13 deletions

View File

@ -2,17 +2,62 @@
# Wide package tool. # Wide package tool.
# #
# See https://github.com/gobuild/gobuild3/tree/master/packer # Command:
# ./pkg.bash ${version} ${target}
# Example:
# ./pkg.bash 1.0.1 /home/daniel/1.0.1/
ver=$1 ver=$1
target=$2
list="conf data doc i18n static views README.md LICENSE"
echo $ver mkdir ${target}
./packer --os darwin --arch 386 -o wide-$ver-darwin-386.tar.gz echo version=${ver}
./packer --os darwin --arch amd64 -o wide-$ver-darwin-amd64.tar.gz echo target=${target}
echo
./packer --os linux --arch 386 -o wide-$ver-linux-386.tar.gz ## darwin
./packer --os linux --arch amd64 -o wide-$ver-linux-amd64.tar.gz os=darwin
./packer --os windows --arch 386 -o wide-$ver-windows-386.zip export GOOS=${os}
./packer --os windows --arch amd64 -o wide-$ver-windows-amd64.zip export GOARCH=386
go build
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} wide --exclude-vcs
rm -f wide
export GOOS=${os}
export GOARCH=amd64
go build
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} wide --exclude-vcs
rm -f wide
## linux
os=linux
export GOOS=${os}
export GOARCH=386
go build
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} wide --exclude-vcs
rm -f wide
export GOOS=${os}
export GOARCH=amd64
go build
tar zcvf ${target}/wide-${ver}-${GOOS}-${GOARCH}.tar.gz ${list} wide --exclude-vcs
rm -f wide
## windows
os=windows
export GOOS=${os}
export GOARCH=386
go build
zip -r ${target}/wide-${ver}-${GOOS}-${GOARCH}.zip ${list} wide.exe
rm -f wide.exe
export GOOS=${os}
export GOARCH=amd64
go build
zip -r ${target}/wide-${ver}-${GOOS}-${GOARCH}.zip ${list} wide.exe
rm -f wide.exe

View File

@ -1,5 +0,0 @@
go install
%GOPATH%\bin\wide.exe
pause