tasks/release.rake in mailit-2009.08 vs tasks/release.rake in mailit-2010.06.03
- old
+ new
@@ -1,52 +1,65 @@
namespace :release do
- task :all => [:release_github, :release_rubyforge]
+ task :prepare => [:reversion, :authors, :gemspec]
+ task :all => ['release:github', 'release:rubyforge', 'release:gemcutter']
- desc 'Display instructions to release on github'
- task :github => [:reversion, :gemspec] do
+ desc 'Release on github'
+ task :github => :prepare do
name, version = GEMSPEC.name, GEMSPEC.version
- puts <<INSTRUCTIONS
-First add the relevant files:
+ sh('git', 'add',
+ 'MANIFEST', 'CHANGELOG', 'AUTHORS',
+ "#{name}.gemspec",
+ "lib/#{name}/version.rb")
-git add AUTHORS MANIFEST CHANGELOG #{name}.gemspec lib/#{name}/version.rb
+ puts <<-INSTRUCTIONS
+================================================================================
-Then commit them, tag the commit, and push:
+I added the relevant files, you can commit them, tag the commit, and push:
git commit -m 'Version #{version}'
git tag -a -m '#{version}' '#{version}'
git push
-INSTRUCTIONS
-
+================================================================================
+ INSTRUCTIONS
end
- # TODO: Not tested
- desc 'Display instructions to release on rubyforge'
- task :rubyforge => [:reversion, :gemspec, :package] do
- name, version = GEMSPEC.name, GEMSPEC.version.to_s
+ desc 'Release on rubyforge'
+ task :rubyforge => ['release:prepare', :package] do
+ name, version = GEMSPEC.name, GEMSPEC.version
- puts <<INSTRUCTIONS
+ pkgs = Dir["pkg/#{name}-#{version}.{tgz,zip}"].map{|file|
+ "rubyforge add_file #{name} #{name} '#{version}' '#{file}'"
+ }
+
+ puts <<-INSTRUCTIONS
+================================================================================
+
To publish to rubyforge do following:
rubyforge login
-rubyforge add_release #{name} #{name} #{version.dump} pkg/#{name}-#{version}.gem
+rubyforge add_release #{name} #{name} '#{version}' pkg/#{name}-#{version}.gem
-After you have done these steps, see:
+To publish the archives for distro packagers:
-VERSION=#{version.dump} rake release:rubyforge_archives
+#{pkgs.join "\n"}
-INSTRUCTIONS
+================================================================================
+ INSTRUCTIONS
end
- desc 'Display instructions to add archives after release:rubyforge'
- task :rubyforge_archives do
- name, version = GEMSPEC.name, GEMSPEC.version.to_s
- puts "Adding archives for distro packagers is:", ""
+ desc 'Release on gemcutter'
+ task :gemcutter => ['release:prepare', :package] do
+ name, version = GEMSPEC.name, GEMSPEC.version
- Dir["pkg/#{name}-#{version}.{tgz,zip}"].each do |file|
- puts "rubyforge add_file %s %s %p %p" % [name, name, version, file]
- end
+ puts <<-INSTRUCTIONS
+================================================================================
- puts
+To publish to gemcutter do following:
+
+gem push pkg/#{name}-#{version}.gem
+
+================================================================================
+ INSTRUCTIONS
end
end