Cloak/release.sh

30 lines
1.0 KiB
Bash
Raw Normal View History

2018-12-30 22:42:51 +00:00
go get github.com/mitchellh/gox
mkdir -p release
2020-11-29 12:43:45 +00:00
rm -f ./release/*
2018-12-30 22:42:51 +00:00
if [ -z "$v" ]; then
echo "Version number cannot be null. Run with v=[version] release.sh"
exit 1
fi
output="{{.Dir}}-{{.OS}}-{{.Arch}}-$v"
2020-05-27 13:40:43 +00:00
osarch="!darwin/arm !darwin/arm64 !darwin/386"
2018-12-30 22:42:51 +00:00
echo "Compiling:"
os="windows linux darwin"
arch="amd64 386 arm arm64 mips mips64 mipsle mips64le"
2020-04-04 23:56:43 +00:00
pushd cmd/ck-client || exit 1
CGO_ENABLED=0 gox -ldflags "-X main.version=${v}" -os="$os" -arch="$arch" -osarch="$osarch" -output="$output"
CGO_ENABLED=0 GOOS="linux" GOARCH="mips" GOMIPS="softfloat" go build -ldflags "-X main.version=${v}" -o ck-client-linux-mips_softfloat-"${v}"
CGO_ENABLED=0 GOOS="linux" GOARCH="mipsle" GOMIPS="softfloat" go build -ldflags "-X main.version=${v}" -o ck-client-linux-mipsle_softfloat-"${v}"
2018-12-30 22:42:51 +00:00
mv ck-client-* ../../release
os="linux"
arch="amd64 386 arm arm64"
2020-04-04 23:56:43 +00:00
pushd ../ck-server || exit 1
CGO_ENABLED=0 gox -ldflags "-X main.version=${v}" -os="$os" -arch="$arch" -osarch="$osarch" -output="$output"
2018-12-30 22:42:51 +00:00
mv ck-server-* ../../release