forked from tiziano88/elm-protobuf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release
executable file
·33 lines (23 loc) · 996 Bytes
/
release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
set -x
readonly BIN=protoc-gen-elm
# Disable cgo in order to ensure static binaries.
export CGO_ENABLED=0
# Make sure the current commit is tagged, using the following command:
# git tag -a v0.0.2 -m 'release'
# Remove the leading "v" from the tag, if necessary.
VERSION=$(git tag --contains | tr -d v)
# Exit if a tag does not exist for the current commit.
[[ -z $VERSION ]] && exit
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-${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-${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-${VERSION}-osx-x86_64
GOOS=darwin GOARCH=amd64 go build -o ./bin/${OUT}/${BIN} ./${BIN}
tar -zcvf ./bin/${OUT}.tar.gz ./bin/${OUT}