From ae832e547976bdad7db98ff2091f51760bc4d41d Mon Sep 17 00:00:00 2001 From: ByteFlinger Date: Sun, 7 May 2017 14:48:38 +0200 Subject: [PATCH] Small improvements to build scripts --- build.sh | 2 +- buildall.bat | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 3d0d6fa..2dfe4d6 100755 --- a/build.sh +++ b/build.sh @@ -11,7 +11,7 @@ if [ "$GOOS" == "windows" ]; then BINARY="${BINARY}.exe" fi -tar cfz /tmp/${NAME}-${VERSION}-tar.gz --exclude="./.git" . +tar cfz /tmp/${NAME}-${VERSION}-tar.gz --exclude="./.git" --exclude="./dist" . go build -o "${BINARY}" -ldflags "-X main.Version=${VERSION} -X main.buildTime=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.commitId=${TRAVIS_COMMIT}" diff --git a/buildall.bat b/buildall.bat index 070a7e5..d32136b 100644 --- a/buildall.bat +++ b/buildall.bat @@ -14,13 +14,15 @@ set ldt=%ldt:~0,4%-%ldt:~4,2%-%ldt:~6,2%_%ldt:~8,2%:%ldt:~10,2%:%ldt:~12,6% set BUILDTIME=%ldt% -set CGO_ENABLED=0 echo Building version=%VERSION% from commit=%COMMITID% for %GOOS%/%GOARCH% + +set CGO_ENABLED=0 go build -a -installsuffix cgo -o "%BINARY%" -ldflags "-X main.version=%VERSION% -X main.buildTime=%BUILDTIME% -X main.commitId=%COMMITID%" set GOOS=windows set GOARCH=amd64 +set BINARY=dist/%NAME%-%GOOS%-%GOARCH%.exe echo Building version=%VERSION% from commit=%COMMITID% for %GOOS%/%GOARCH% -go build -o "%BINARY%.exe" -ldflags "-X main.version=%VERSION% -X main.buildTime=%BUILDTIME% -X main.commitId=%COMMITID%" \ No newline at end of file +go build -o "%BINARY%" -ldflags "-X main.version=%VERSION% -X main.buildTime=%BUILDTIME% -X main.commitId=%COMMITID%" \ No newline at end of file