2016-03-27 14:37:54 +00:00
|
|
|
#!/bin/sh
|
2016-03-28 07:57:20 +00:00
|
|
|
|
2016-04-12 07:37:53 +00:00
|
|
|
OS="darwin linux"
|
2016-03-28 07:57:20 +00:00
|
|
|
ARCH="amd64"
|
2016-05-04 07:10:43 +00:00
|
|
|
VERSION=$1
|
2016-03-28 07:57:20 +00:00
|
|
|
|
|
|
|
for GOOS in $OS; do
|
|
|
|
for GOARCH in $ARCH; do
|
2016-04-13 07:22:04 +00:00
|
|
|
EXE="gorush"
|
|
|
|
(test "$GOOS" = "windows") && EXE="gorush.exe"
|
2016-03-27 14:48:20 +00:00
|
|
|
|
|
|
|
echo "Build: ${GOOS}, Arch: ${GOARCH}, EXE: ${EXE}"
|
2016-08-15 12:43:34 +00:00
|
|
|
GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=0 go build -ldflags="-s -w -X main.Version=${VERSION}" -o bin/$GOOS/$GOARCH/${EXE} gorush.go;
|
2016-05-04 07:10:43 +00:00
|
|
|
tar -C bin/$GOOS/$GOARCH -czf bin/gorush-$VERSION-$GOOS-$GOARCH.tar.gz gorush
|
2016-03-27 14:37:54 +00:00
|
|
|
done
|
|
|
|
done
|