Skip to content

Commit

Permalink
Fix release script
Browse files Browse the repository at this point in the history
  • Loading branch information
tiziano88 committed Dec 27, 2016
1 parent 22cd628 commit 6ab1db0
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions release
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,29 @@

set -x

readonly BIN=protoc-gen-elm

# Make sure the current commit is tagged, using the following command:
# git tag -a 0.0.2 -m 'release'
# git tag -a v0.0.2 -m 'release'

# Remove the leading "v" from the tag, if necessary.
VERSION=$(git tag --contains | tr -d v)

TAG=$(git tag --contains)
[[ -z $TAG ]] && exit
# Exit if a tag does not exist for the current commit.
[[ -z $VERSION ]] && exit

OUT=elm-protobuf-${TAG}-linux-x86_32
GOOS=linux GOARCH=386 go build -o ./bin/${OUT}/protoc-gen-elm ./protoc-gen-elm
OUT=elm-protobuf-${VERSION}-linux-x86_32
GOOS=linux GOARCH=386 go build -o ./bin/${OUT}/${BIN} ./${BIN}
tar -zcvf ./bin/${OUT}.tar.gz ./bin/${OUT}

OUT=elm-protobuf-${TAG}-linux-x86_64
GOOS=linux GOARCH=amd64 go build -o ./bin/${OUT}/protoc-gen-elm ./protoc-gen-elm
OUT=elm-protobuf-${VERSION}-linux-x86_64
GOOS=linux GOARCH=amd64 go build -o ./bin/${OUT}/${BIN} ./${BIN}
tar -zcvf ./bin/${OUT}.tar.gz ./bin/${OUT}

OUT=elm-protobuf-${TAG}-osx-x86_32
GOOS=darwin GOARCH=386 go build -o ./bin/${OUT}/protoc-gen-elm ./protoc-gen-elm
OUT=elm-protobuf-${VERSION}-osx-x86_32
GOOS=darwin GOARCH=386 go build -o ./bin/${OUT}/${BIN} ./${BIN}
tar -zcvf ./bin/${OUT}.tar.gz ./bin/${OUT}

OUT=elm-protobuf-${TAG}-osx-x86_64
GOOS=darwin GOARCH=amd64 go build -o ./bin/${OUT}/protoc-gen-elm ./protoc-gen-elm
OUT=elm-protobuf-${VERSION}-osx-x86_64
GOOS=darwin GOARCH=amd64 go build -o ./bin/${OUT}/${BIN} ./${BIN}
tar -zcvf ./bin/${OUT}.tar.gz ./bin/${OUT}

0 comments on commit 6ab1db0

Please sign in to comment.