From 1576119576aae45b3fdc652c5f015680266fa2e5 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Wed, 23 Mar 2016 12:39:24 +0100 Subject: [PATCH] adding build file --- build.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 build.sh diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..fc48ca9 --- /dev/null +++ b/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +buildpath=/tmp/gh-osc +target=gh-osc +timestamp=$(date "+%Y%m%d%H%M%S") +mkdir -p ${buildpath} +gobuild="go build -o $buildpath/$target go/cmd/gh-osc/main.go" + +echo "Building OS/X binary" +echo "GO15VENDOREXPERIMENT=1 GOOS=darwin GOARCH=amd64 $gobuild" | bash +(cd $buildpath && tar cfz ./gh-osc-binary-osx-${timestamp}.tar.gz $target) + +echo "Building linux binary" +echo "GO15VENDOREXPERIMENT=1 GOOS=linux GOARCH=amd64 $gobuild" | bash +(cd $buildpath && tar cfz ./gh-osc-binary-linux-${timestamp}.tar.gz $target) + +echo "Binaries found in:" +ls -1 $buildpath/gh-osc-binary*${timestamp}.tar.gz