-
Notifications
You must be signed in to change notification settings - Fork 354
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 #306 from github/script-bump
script/bump: an automated way up bumping the gem version
- Loading branch information
Showing
1 changed file
with
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash -ex | ||
|
||
(git branch | grep -q '* master') || { | ||
echo "Only release from the master branch." | ||
exit 1 | ||
} | ||
|
||
VERSION_FILE="./lib/github-pages/version.rb" | ||
OLD_VERSION=$(curl "https://rubygems.org/api/v1/versions/github-pages/latest.json" | jq -r .version) | ||
NEW_VERSION=$(expr $OLD_VERSION + 1) | ||
echo -e "module GitHubPages\n VERSION = $NEW_VERSION\nend" > $VERSION_FILE | ||
git add $VERSION_FILE | ||
git commit -m "Bump :gem: to v$NEW_VERSION" | ||
git push origin master | ||
|
||
script/release | ||
|
||
echo "Ok! v$NEW_VERSION is released." | ||
echo "Please fill out the release: https://github.com/github/pages-gem/releases/tag/v$NEW_VERSION" | ||
echo "Here's the git history since the last release:" | ||
git log --one-line v$OLD_VERSION...v$NEW_VERSION |