build.sh: add target to build release

While there, remove non actionable warning.
This commit is contained in:
Simone Basso 2019-10-03 11:45:49 +02:00
parent a488c8d2a3
commit f3193b4a7c

View File

@ -2,7 +2,6 @@
set -e
if [ "$GOPATH" != "" ]; then
echo "$0: WARNING: unsetting GOPATH as we don't need it" 1>&2
unset GOPATH
fi
@ -24,6 +23,18 @@ elif [ "$1" = "macos" ]; then
set -x
go build -o dist/macos/amd64/ooniprobe -v ./cmd/ooniprobe
elif [ "$1" = "release" ]; then
set -x
v=`git describe --tags`
$0 linux
tar -czf ooniprobe-linux-amd64-$v.tar.gz ./dist/linux/amd64
$0 macos
tar -czf ooniprobe-macos-amd64-$v.tar.gz ./dist/macos/amd64
$0 windows
tar -czf ooniprobe-windows-amd64-$v.tar.gz ./dist/windows/amd64
echo ""
echo "Now sign the packages and upload them to GitHub"
elif [ "$1" = "_travis-linux" ]; then
set -x
$0 linux
@ -40,7 +51,7 @@ elif [ "$1" = "_travis-osx" ]; then
go test -v -coverprofile=ooni.cov ./...
elif [ "$1" = "help" ]; then
echo "Usage: $0 linux | macos | windows"
echo "Usage: $0 linux | macos | release | windows"
echo ""
echo "Builds OONI on supported systems. The output binary will"
echo "be saved at './dist/<system>/<arch>/ooniprobe[.exe]'."
@ -61,6 +72,10 @@ elif [ "$1" = "help" ]; then
echo ""
echo "- brew upgrade"
echo ""
echo "# Release"
echo ""
echo "Will build ooniprobe for all supported systems."
echo ""
echo "# Windows"
echo ""
echo "You must be on macOS. You must install Measurement Kit once using:"