-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from rightscale/automate_release
Automate creating the GitHub Release in the RELEASING.md instructions
- Loading branch information
Showing
2 changed files
with
39 additions
and
5 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,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# use GNU coreutils sort because it supports version sort | ||
case `uname` in | ||
(Darwin) | ||
sed='gsed' | ||
sort='gsort' | ||
;; | ||
(*) | ||
sed='sed' | ||
sort='sort' | ||
;; | ||
esac | ||
|
||
# find the latest version tagged in Git | ||
while read version; do | ||
if [[ $version =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
break | ||
fi | ||
done < <(git tag -l 'v*' | $sort --reverse --version-sort) | ||
|
||
# create a GitHub release from the latest version tagged in Git with ChangeLog entries and pre-compiled binary links | ||
hub release create --file - $version <<EOF | ||
$version Release | ||
$($sed -nre "/^${version//./\\.} \/ .+\$/,/^$/{/^${version//./\\.} \/ .+\$/d;/^-+$/d;p}" cmd/fpt/ChangeLog.md) | ||
Pre-compiled binaries: | ||
* Linux: [$version/fpt-linux-amd64.tgz](https://binaries.rightscale.com/rsbin/fpt/$version/fpt-linux-amd64.tgz) | ||
* macOS: [$version/fpt-darwin-amd64.tgz](https://binaries.rightscale.com/rsbin/fpt/$version/fpt-darwin-amd64.tgz) | ||
* Windows: [$version/fpt-windows-amd64.zip](https://binaries.rightscale.com/rsbin/fpt/$version/fpt-windows-amd64.zip) | ||
EOF |