add a build script for a static stripped binary

Related #99 and #103
This commit is contained in:
Gokcehan committed 2018-06-26 16:29:48 +03:00
1 parent a607e53e51
commit fe786aae4c
2 files changed
+13 -3

No files matched your search

Executable
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
# Builds a static stripped binary with version information.
#
# This script is used to build a binary for the current platform. Cgo is
# disabled to make sure the binary is statically linked. Appropriate flags are
# given to the go compiler to strip the binary. Current git tag is passed to
# the compiler to be used as the version in the binary.
CGO_ENABLED=0 go build -ldflags="-s -w -X main.gVersion=$(git describe --tags)" "$@"
+4 -3
View File
@@ -3,9 +3,10 @@
#
# This script is used to build binaries for all supported platforms. Cgo is
# disabled to make sure binaries are statically linked. Appropriate flags are
# given to the go compiler to strip binaries. These are then compressed in an
# archive form (`.zip` for windows and `.tar.gz` for the rest) within a folder
# named `dist`.
# given to the go compiler to strip binaries. Current git tag is passed to the
# compiler to be used as the version in binaries. These are then compressed in
# an archive form (`.zip` for windows and `.tar.gz` for the rest) within a
# folder named `dist`.
set -o verbose