2020-12-20 00:21:16 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
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"
|
2021-03-25 20:09:30 +00:00
|
|
|
osarch="!darwin/arm !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
|
2020-11-29 12:36:20 +00:00
|
|
|
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
|
2020-12-20 00:21:16 +00:00
|
|
|
popd
|
2018-12-30 22:42:51 +00:00
|
|
|
|
|
|
|
os="linux"
|
|
|
|
arch="amd64 386 arm arm64"
|
2020-12-20 00:21:16 +00:00
|
|
|
pushd cmd/ck-server || exit 1
|
2020-11-29 12:36:20 +00:00
|
|
|
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
|
2020-12-20 00:21:16 +00:00
|
|
|
popd
|