aboutsummaryrefslogtreecommitdiffstats
path: root/tasks/release.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tasks/release.rb')
-rw-r--r--tasks/release.rb29
1 files changed, 22 insertions, 7 deletions
diff --git a/tasks/release.rb b/tasks/release.rb
index d8c1390eef..ea7f66a171 100644
--- a/tasks/release.rb
+++ b/tasks/release.rb
@@ -1,4 +1,4 @@
-FRAMEWORKS = %w( activesupport activemodel activerecord actionview actionpack activejob actionmailer railties )
+FRAMEWORKS = %w( activesupport activemodel activerecord actionview actionpack activejob actionmailer actioncable railties )
root = File.expand_path('../../', __FILE__)
version = File.read("#{root}/RAILS_VERSION").strip
@@ -57,8 +57,6 @@ directory "pkg"
sh "gem install #{gem}"
end
- task :prep_release => [:ensure_clean_state, :build]
-
task :push => :build do
sh "gem push #{gem}"
end
@@ -66,13 +64,24 @@ directory "pkg"
end
namespace :changelog do
+ task :header do
+ (FRAMEWORKS + ['guides']).each do |fw|
+ require 'date'
+ fname = File.join fw, 'CHANGELOG.md'
+
+ header = "## Rails #{version} (#{Date.today.strftime('%B %d, %Y')}) ##\n\n* No changes.\n\n\n"
+ contents = header + File.read(fname)
+ File.open(fname, 'wb') { |f| f.write contents }
+ end
+ end
+
task :release_date do
(FRAMEWORKS + ['guides']).each do |fw|
require 'date'
- replace = '\1(' + Date.today.strftime('%B %d, %Y') + ')'
+ replace = "## Rails #{version} (#{Date.today.strftime('%B %d, %Y')}) ##\n"
fname = File.join fw, 'CHANGELOG.md'
- contents = File.read(fname).sub(/^([^(]*)\(unreleased\)/, replace)
+ contents = File.read(fname).sub(/^(## Rails .*)\n/, replace)
File.open(fname, 'wb') { |f| f.write contents }
end
end
@@ -98,7 +107,7 @@ namespace :all do
task :push => FRAMEWORKS.map { |f| "#{f}:push" } + ['rails:push']
task :ensure_clean_state do
- unless `git status -s | grep -v RAILS_VERSION`.strip.empty?
+ unless `git status -s | grep -v 'RAILS_VERSION\\|CHANGELOG\\|Gemfile.lock'`.strip.empty?
abort "[ABORTING] `git status` reports a dirty tree. Make sure all changes are committed"
end
@@ -108,6 +117,10 @@ namespace :all do
end
end
+ task :bundle do
+ sh 'bundle check'
+ end
+
task :commit do
File.open('pkg/commit_message.txt', 'w') do |f|
f.puts "# Preparing for #{version} release\n"
@@ -124,5 +137,7 @@ namespace :all do
sh "git push --tags"
end
- task :release => %w(ensure_clean_state build commit tag push)
+ task :prep_release => %w(ensure_clean_state build)
+
+ task :release => %w(ensure_clean_state build bundle commit tag push)
end