Skip to content

Commit

Permalink
build.sh: build for linux,darwin,windows
Browse files Browse the repository at this point in the history
  • Loading branch information
HeavyHorst committed Oct 20, 2016
1 parent 63d0cd0 commit 95ccb8b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin/
11 changes: 9 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/bin/bash

version=0.3.0
version=0.3.1
date=`date -u '+%Y-%m-%d %H:%M:%S'`
commit=`git rev-parse HEAD`
os_list=( "linux" "darwin" "windows" )

CGO_ENABLED=0 go build -a -tags netgo -ldflags \
for os in "${os_list[@]}"
do
echo "Build remco for $os"
GOOS=${os} CGO_ENABLED=0 go build -a -tags netgo -o bin/remco_${os} -ldflags \
"-w -X 'main.version=$version'
-X 'main.buildDate=$date'
-X 'main.commit=$commit'"

zip -r bin/remco_${version}_${os}_amd64.zip bin/remco_${os}
done

0 comments on commit 95ccb8b

Please sign in to comment.