Merge pull request #354 from ploxiln/dist_win_exe

dist.sh: add .exe for windows build
This commit is contained in:
Jehiah Czebotar 2017-03-27 14:49:40 -04:00 committed by GitHub
commit 7d920c98a6

View File

@ -20,9 +20,13 @@ echo "... running tests"
for os in windows linux darwin; do for os in windows linux darwin; do
echo "... building v$version for $os/$arch" echo "... building v$version for $os/$arch"
EXT=
if [ $os = windows ]; then
EXT=".exe"
fi
BUILD=$(mktemp -d ${TMPDIR:-/tmp}/oauth2_proxy.XXXXXX) BUILD=$(mktemp -d ${TMPDIR:-/tmp}/oauth2_proxy.XXXXXX)
TARGET="oauth2_proxy-$version.$os-$arch.$goversion" TARGET="oauth2_proxy-$version.$os-$arch.$goversion"
GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build -o $BUILD/$TARGET/oauth2_proxy || exit 1 GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build -o $BUILD/$TARGET/oauth2_proxy$EXT || exit 1
pushd $BUILD pushd $BUILD
tar czvf $TARGET.tar.gz $TARGET tar czvf $TARGET.tar.gz $TARGET
mv $TARGET.tar.gz $DIR/dist mv $TARGET.tar.gz $DIR/dist