Skip to content
Browse files

Add release task

  • Loading branch information...
1 parent ebec6fb commit 3608cbb16f82a678db789e94eae91701d578e6e5 @satchmorun committed
Showing with 25 additions and 2 deletions.
  1. +25 −2 Rakefile
27 Rakefile
@@ -1,6 +1,29 @@
-desc "Build minilex gem in"
-task :build do
+require File.expand_path('../lib/minilex', __FILE__)
+version = Minilex::VERSION
+name = 'minilex'
+desc "Build minilex gem"
+task :build => :clean do
sh "mkdir -p pkg"
sh "gem build minilex.gemspec"
+desc "Create tag v#{version}, build, and push to Rubygems"
+task :release => :build do
+ unless `git branch` =~ /^\* master$/
+ puts "You must be on the master branch to release!"
+ exit!
+ end
+ sh "git commit --allow-empty -a -m 'Release #{version}'"
+ sh "git tag v#{version}"
+ sh "git push origin master"
+ sh "git push origin v#{version}"
+ sh "gem push #{name}-#{version}.gem"
+desc "Clean up generated files"
+task :clean do
+ sh "rm -f *.gem"

0 comments on commit 3608cbb

Please sign in to comment.
Something went wrong with that request. Please try again.