Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

script for patch-level releases

  • Loading branch information...
commit ec6db4b5f0ee196e6b1e8cec93a2f0eade90070c 1 parent f93b392
@ronhopper authored
Showing with 33 additions and 1 deletion.
  1. +4 −1 lib/jeeves/version.rb
  2. +29 −0 script/release_patch
View
5 lib/jeeves/version.rb
@@ -1,4 +1,7 @@
module Jeeves
- VERSION = "0.2.1"
+ MAJOR_VERSION = 0
+ MINOR_VERSION = 2
+ PATCH_VERSION = 1
+ VERSION = [MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION].join('.')
end
View
29 script/release_patch
@@ -0,0 +1,29 @@
+#!/bin/sh
+set -e
+
+BRANCH=`git branch | grep '*' | cut -d ' ' -f 2`
+test "$BRANCH" != 'master' && (echo Must be on branch 'master'; exit 1)
+
+STATUS=`git status | grep -v ^#`
+test "$STATUS" != 'nothing to commit (working directory clean)' && (echo Working directory must be clean; exit 1)
+
+bundle exec rspec || (echo Must pass all tests; exit 1)
+
+VERSION_FILE=lib/jeeves/version.rb
+CURRENT_MAJOR_VERSION=`grep -o 'MAJOR_VERSION = [0-9]\+' $VERSION_FILE | cut -d ' ' -f 3`
+CURRENT_MINOR_VERSION=`grep -o 'MINOR_VERSION = [0-9]\+' $VERSION_FILE | cut -d ' ' -f 3`
+CURRENT_PATCH_VERSION=`grep -o 'PATCH_VERSION = [0-9]\+' $VERSION_FILE | cut -d ' ' -f 3`
+NEXT_PATCH_VERSION=`expr $CURRENT_PATCH_VERSION + 1`
+sed -i"" "s/PATCH_VERSION = $CURRENT_PATCH_VERSION/PATCH_VERSION = $NEXT_PATCH_VERSION/g" $VERSION_FILE
+
+NEW_VERSION="$CURRENT_MAJOR_VERSION.$CURRENT_MINOR_VERSION.$NEXT_PATCH_VERSION"
+git commit -a -m "bumped version to $NEW_VERSION"
+git tag -a "v$NEW_VERSION" -m "Version $NEW_VERSION"
+git push origin master
+git push origin master --tags
+
+GEM="jeeves-$NEW_VERSION.gem"
+gem build jeeves.gemspec
+gem push "$GEM"
+mv "$GEM" dist/
+
Please sign in to comment.
Something went wrong with that request. Please try again.