From f4cad346aef6a3ab0e1bb068fa34f7bb6e0fc6f6 Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Fri, 30 Sep 2011 20:35:14 -0500 Subject: [PATCH] add release task --- sinatra-contrib/Rakefile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sinatra-contrib/Rakefile b/sinatra-contrib/Rakefile index 039b0707..aa680597 100644 --- a/sinatra-contrib/Rakefile +++ b/sinatra-contrib/Rakefile @@ -1,6 +1,7 @@ $LOAD_PATH.unshift File.expand_path('../lib', __FILE__) require 'open-uri' require 'yaml' +require 'sinatra/contrib/version' desc "run specs" task(:spec) { ruby '-S rspec spec -c' } @@ -28,7 +29,6 @@ task :doc => 'doc:all' desc "generate gemspec" task 'sinatra-contrib.gemspec' do - require 'sinatra/contrib/version' content = File.read 'sinatra-contrib.gemspec' fields = { @@ -59,3 +59,17 @@ task :travis, [:branch] do |t, a| system 'git add .travis.yml && git diff --cached .travis.yml' end +task :release => :gemspec do + sh <<-SH + rm -Rf sinatra-contrib*.gem && + gem build sinatra-contrib.gemspec && + gem install sinatra-contrib*.gem --local && + gem push sinatra-contrib*.gem && + git commit --allow-empty -a -m '#{Sinatra::Contrib::VERSION} release' && + git tag -s v#{Sinatra::Contrib::VERSION} -m '#{Sinatra::Contrib::VERSION} release' && + git tag -s #{Sinatra::Contrib::VERSION} -m '#{Sinatra::Contrib::VERSION} release' && + git push && (git push sinatra || true) && + git push --tags && (git push sinatra --tags || true) + SH +end +