diff --git a/cmd/issueToken/cross_build.sh b/cmd/issueToken/cross_build.sh new file mode 100755 index 0000000..d48406d --- /dev/null +++ b/cmd/issueToken/cross_build.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +VERSION=`git describe --tags --dirty` +BUILD=`date +%FT%T%z` + +xgo \ +--targets=windows/386,windows/amd64,darwin/386,darwin/amd64,linux/386,linux/amd64 \ +-ldflags "-s -w -X github.com/dabankio/TokenIssuer/cmd/issueToken.Version=$VERSION -X github.com/dabankio/TokenIssuer/cmd/issueToken.BuildDate=$BUILD" \ +./ \ No newline at end of file diff --git a/cmd/issueToken/main.go b/cmd/issueToken/main.go index 4c089eb..42c58e4 100644 --- a/cmd/issueToken/main.go +++ b/cmd/issueToken/main.go @@ -34,6 +34,11 @@ var ( decimals uint64 owner string prikeyStr string + + // Version build params + Version string + // BuildDate build params + BuildDate string ) func init() { @@ -49,6 +54,8 @@ func init() { func main() { flag.Parse() + fmt.Printf("issueToken(%s) by Dabank Authors, built on %s\n", Version, BuildDate) + var err error defer func() { if err != nil { diff --git a/cmd/issueToken/native_build.sh b/cmd/issueToken/native_build.sh new file mode 100755 index 0000000..8674a6f --- /dev/null +++ b/cmd/issueToken/native_build.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +VERSION=`git describe --tags --dirty` +BUILD=`date +%FT%T%z` + +go build -ldflags "-s -w -X github.com/dabankio/TokenIssuer/cmd/issueToken.Version=$VERSION -X github.com/dabankio/TokenIssuer/cmd/issueToken.BuildDate=$BUILD" \ No newline at end of file