From 95ccb8b94494c897df0a405303e5d872385ff887 Mon Sep 17 00:00:00 2001 From: Rene Kaufmann Date: Thu, 20 Oct 2016 21:18:52 +0200 Subject: [PATCH] build.sh: build for linux,darwin,windows --- .gitignore | 1 + build.sh | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e660fd93 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +bin/ diff --git a/build.sh b/build.sh index 3ea52d64..34f11bcf 100755 --- a/build.sh +++ b/build.sh @@ -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