Add release management rake tasks.

This commit is contained in:
Patrick Mahoney 2012-02-09 08:14:47 -06:00
parent 1a9fd328d4
commit 662a86f2ab
2 changed files with 25 additions and 3 deletions

View File

@ -1,7 +1,9 @@
require 'ffi'
require 'rake/extensiontask' require 'rake/extensiontask'
require 'rake/testtask' require 'rake/testtask'
require 'rake/version_task'
require 'rubygems/package_task' require 'rubygems/package_task'
require 'ffi' require 'rubygems/gem_runner'
def gemspec def gemspec
@gemspec ||= Gem::Specification.load('process_shared.gemspec') @gemspec ||= Gem::Specification.load('process_shared.gemspec')
@ -23,9 +25,28 @@ Rake::TestTask.new(:test => [:compile]) do |t|
t.libs.push 'spec' t.libs.push 'spec'
end end
Gem::PackageTask.new(gemspec) do |p| pkg = Gem::PackageTask.new(gemspec) do |p|
p.need_tar = true p.need_tar = true
p.gem_spec = gemspec p.gem_spec = gemspec
end end
task :gem => :compile task :gem => :compile
Rake::VersionTask.new do |t|
t.with_git_tag = true
end
task :push => :gem do
gem_file = File.basename gemspec.cache_file
gem_path = File.join pkg.package_dir, gem_file
Gem::GemRunner.new.run(["push", gem_path])
end
if Version.current.prerelease?
vrelease = Version.current.bump!
desc "Release version #{vrelease}"
task :release => [:test, 'version:bump'] do
# must run in subprocess so tasks use newwer versioned gemspec
sh %{rake push version:bump:pre}
end
end

View File

@ -1,6 +1,6 @@
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = 'process_shared' s.name = 'process_shared'
s.version = '0.1.1' s.version = File.read(File.expand_path('../VERSION', __FILE__))
s.platform = Gem::Platform::RUBY s.platform = Gem::Platform::RUBY
s.has_rdoc = true s.has_rdoc = true
s.extra_rdoc_files = ["README.rdoc", "ChangeLog", "COPYING"] s.extra_rdoc_files = ["README.rdoc", "ChangeLog", "COPYING"]
@ -18,4 +18,5 @@ Gem::Specification.new do |s|
s.add_development_dependency('rake-compiler') s.add_development_dependency('rake-compiler')
s.add_development_dependency('minitest') s.add_development_dependency('minitest')
s.add_development_dependency('minitest-matchers') s.add_development_dependency('minitest-matchers')
s.add_development_dependency('version')
end end