tasks/release.rake in alf-0.15.0 vs tasks/release.rake in alf-0.16.0
- old
+ new
@@ -1,9 +1,53 @@
namespace :release do
+ desc "Bump the version number"
+ task :bump, :to do |t, args|
+ require 'path'
+ raise "Missing version number" unless to = args[:to]
+ in_each_sub_module("bump to #{to}") do |sub|
+ noespec = Path("alf-#{sub}.noespec")
+ content = noespec.read.gsub(/^ version:\n (.*?)\n/){|x|
+ " version:\n #{to}\n"
+ }
+ noespec.write(content)
+ system("noe go -s")
+ system("git commit -a -m 'Bump version to #{to}'")
+ end
+ end
+
+ desc "Set the CHANGELOG 'FIX ME' to the current date"
+ task :stamp do
+ require 'time'
+ require 'path'
+ require 'alf/version'
+ date = Time.now.strftime("%Y-%m-%d")
+ version = Alf::VERSION
+ cmd = "git commit -a -m 'Releasing #{version}'"
+ doit = ->{
+ clog = Path('CHANGELOG.md')
+ clog.write clog.read.gsub(/FIX ME/, date)
+ system(cmd)
+ }
+ in_each_sub_module("stamping CHANGELOG in") do |sub|
+ doit()
+ end
+ doit()
+ end
+
+ desc "Tag the version and push everything"
+ task :tag => :stamp do
+ require 'alf/version'
+ version = Alf::VERSION
+ cmd = "git tag v#{version} && git push origin master --tags"
+ in_each_sub_module("'git tag and push' in") do |sub|
+ system(cmd)
+ end
+ end
+
desc "Create all gems, including in sub-modules"
- task :gem do
+ task :gem => :doc do
cmd = "rm -rf pkg && rake gem"
in_each_sub_module("'rake gem' in") do |sub|
system(cmd)
end
system(cmd)
@@ -20,10 +64,10 @@
desc "Release it!"
task :go => :gem do
require 'alf/version'
version = Alf::VERSION
- cmd = "gem push pkg/*.gem && git tag v#{version} && git push origin --tags"
+ cmd = "gem push pkg/*.gem"
in_each_sub_module("'gem push & git tag' in") do |sub|
system(cmd)
end
system(cmd)
end
\ No newline at end of file