Skip to content

Commit

Permalink
Small improvements to build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteFlinger authored and ByteFlinger committed May 7, 2017
1 parent ce9e80c commit ae832e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
6 changes: 4 additions & 2 deletions buildall.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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%"
go build -o "%BINARY%" -ldflags "-X main.version=%VERSION% -X main.buildTime=%BUILDTIME% -X main.commitId=%COMMITID%"

0 comments on commit ae832e5

Please sign in to comment.