Skip to content

Commit

Permalink
Master release task
Browse files Browse the repository at this point in the history
Created simple Rakefile in root directory that performs full release
cycle for Sunspot and Sunspot::Rails. Also remove horribly bad file
copying from gemspec and into that task.

[sunspot#138 state:resolved]
  • Loading branch information
Mat Brown committed Aug 24, 2010
1 parent ae98d31 commit ec86d41
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
27 changes: 21 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
require 'spec'
require 'spec/rake/spectask'
desc 'Release Sunspot and Sunspot::Rails to Gemcutter'
task :release do
def system(command)
puts command
end
FileUtils.cp('README.rdoc', 'sunspot/')
system "git commit sunspot/README.rdoc -qm 'Updating README for gem release'"

Spec::Rake::SpecTask.new('spec') do |t|
t.spec_files = FileList[File.join(File.dirname(__FILE__), 'sunspot', 'spec', 'api')]
end
require File.expand_path('../sunspot/lib/sunspot/version', __FILE__)

version_tag = "v#{Sunspot::VERSION}"
system "git tag '#{version_tag}' -a 'Release version #{Sunspot::VERSION}'"
system "git push origin #{version_tag}:#{version_tag}"

system "gem build sunspot/sunspot.gemspec"
system "gem build sunspot_rails/sunspot_rails.gemspec"

task :default => :spec
system "gem push sunspot-#{Sunspot::VERSION}.gem"
system "gem push sunspot_rails-#{Sunspot::VERSION}.gem"

system "rm sunspot-#{Sunspot::VERSION}.gem"
system "rm sunspot_rails-#{Sunspot::VERSION}.gem"
end
2 changes: 0 additions & 2 deletions sunspot/sunspot.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ $:.unshift(lib) unless $:.include?(lib)

require 'sunspot/version'

FileUtils.cp('../README.rdoc', './')

Gem::Specification.new do |s|
s.name = 'sunspot'
s.version = Sunspot::VERSION
Expand Down

0 comments on commit ec86d41

Please sign in to comment.