-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
if [[ "$#" -ne 1 ]]; then | ||
echo "usage: $0 <version>" | ||
exit 1 | ||
fi | ||
|
||
readonly version=$1 | ||
|
||
cd "$(dirname "$0")"/.. | ||
|
||
GPG_TTY=$(tty) | ||
export GPG_TTY | ||
|
||
git tag --sign v"$version" | ||
git push origin v"$version" | ||
|
||
env GOOS=darwin GOARCH=amd64 go build -o driving-time-"$version"-darwin-amd64 | ||
env GOOS=linux GOARCH=amd64 go build -o driving-time-"$version"-linux-amd64 | ||
env GOOS=windows GOARCH=amd64 go build -o driving-time-"$version"-windows-amd64.exe | ||
|
||
description=$(mktemp /tmp/description.XXXX) | ||
echo -e "v$version\\n" > "$description" | ||
echo -e "Assets:\\nsha256\\n\`\`\`" >> "$description" | ||
shasum -a 256 driving-time-"$version"-* >> "$description" | ||
echo '```' >> "$description" | ||
|
||
hub release create \ | ||
--browse \ | ||
--attach driving-time-"$version"-darwin-amd64 \ | ||
--attach driving-time-"$version"-linux-amd64 \ | ||
--attach driving-time-"$version"-windows-amd64.exe \ | ||
--file "$description" \ | ||
v"$version" | ||
|
||
rm "$description" | ||
rm driving-time-"$version"-* |