Fix release script

This commit is contained in:
Andrey Petrov 2016-07-17 17:58:57 -04:00
parent ace2bc5124
commit 773e3c8cd9
2 changed files with 7 additions and 4 deletions

View File

@ -3,7 +3,7 @@ KEY = host_key
PORT = 2022 PORT = 2022
SRCS = %.go SRCS = %.go
VERSION := $(shell git describe --long --tags --dirty --always) VERSION := $(shell git describe --tags --dirty --always)
LDFLAGS = LDFLAGS="-X main.Version=$(VERSION)" LDFLAGS = LDFLAGS="-X main.Version=$(VERSION)"
all: $(BINARY) all: $(BINARY)
@ -33,6 +33,6 @@ test:
golint ./... golint ./...
release: release:
ENV=GOOS=linux GOARCH=amd64 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE GOOS=linux GOARCH=amd64 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE
ENV=GOOS=linux GOARCH=386 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE GOOS=linux GOARCH=386 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE
ENV=GOOS=darwin GOARCH=amd64 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE GOOS=darwin GOARCH=amd64 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE

View File

@ -16,12 +16,15 @@ main() {
if [[ ! "$GOOS" ]]; then if [[ ! "$GOOS" ]]; then
export GOOS="linux" export GOOS="linux"
echo "Defaulting to GOOS=$GOOS"
fi fi
if [[ ! "$GOARCH" ]]; then if [[ ! "$GOARCH" ]]; then
export GOARCH="amd64" export GOARCH="amd64"
echo "Defaulting to GOARCH=$GOARCH"
fi fi
if [[ ! "$BUILDDIR" ]]; then if [[ ! "$BUILDDIR" ]]; then
export BUILDDIR="build" export BUILDDIR="build"
echo "Defaulting to BUILDDIR=$BUILDDIR"
fi fi
build "$@" build "$@"