Skip to content

Commit

Permalink
Add prepare-release.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
barnardb committed Apr 20, 2019
1 parent 6cb3c21 commit 0bbec84
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/cookies
/*.gz
21 changes: 21 additions & 0 deletions prepare-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail

cd "$(dirname "$0")"

[ $# -eq 1 ] && grep -qE '^\d+\.\d+\.\d+$' <<<"$1" || {
echo "usage: $0 <semantic-version>" >&2
exit 2
}

set -x

tag="v$1"

export GO111MODULE=on
export GOOS=darwin
export GOARCH=amd64
go build
archive="cookies_${tag}_${GOOS}_${GOARCH}.gz"
gzip --stdout cookies >"${archive}"
hub release create -d -a "${archive}" -m "${tag}" "${tag}"

0 comments on commit 0bbec84

Please sign in to comment.