Skip to content

Commit

Permalink
Merge pull request #306 from github/script-bump
Browse files Browse the repository at this point in the history
script/bump: an automated way up bumping the gem version
  • Loading branch information
benbalter authored Jul 13, 2016
2 parents a330ce7 + 4464813 commit 5ac8afb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions script/bump
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

0 comments on commit 5ac8afb

Please sign in to comment.