Skip to content

Commit

Permalink
Add build-release script
Browse files Browse the repository at this point in the history
  • Loading branch information
schmir committed Feb 19, 2021
1 parent ebdc6bb commit 96543fb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ jobs:
- restore_cache:
keys:
- shuttermint-go-v8-{{ checksum "go.sum" }}
- run: make build
- run: env VERSION=${CIRCLE_TAG} ./build-release
- run: go install github.com/tcnksm/[email protected]
- run: ghr ${CIRCLE_TAG} bin/shuttermint
- run: ghr ${CIRCLE_TAG} bin/

mint-lint:
executor: go
Expand Down
16 changes: 16 additions & 0 deletions shuttermint/build-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /usr/bin/env bash
set -euo pipefail

: "${GO:=go}"

if [[ -z "${VERSION}" ]]; then
VERSION=$(git describe --tags --always --abbrev=4 --dirty)
fi


arch=amd64
for os in linux freebsd openbsd darwin; do
target=bin/shuttermint-${os}-${arch}-${VERSION}
echo "Building ${target}"
env GOARCH=${arch} GOOS=${os} ${GO} build -o ${target} -ldflags "-X github.com/brainbot-com/shutter/shuttermint/cmd/shversion.Version=${VERSION}" .
done

0 comments on commit 96543fb

Please sign in to comment.