diff options
Diffstat (limited to 'tasks')
-rw-r--r-- | tasks/release.rb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tasks/release.rb b/tasks/release.rb index 4711974b63..de9c51a140 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 @@ -13,6 +13,7 @@ directory "pkg" task :clean do rm_f gem + sh "cd #{framework} && bundle exec rake package:clean" unless framework == "rails" end task :update_versions do @@ -27,7 +28,7 @@ directory "pkg" file = Dir[glob].first ruby = File.read(file) - major, minor, tiny, pre = version.split('.') + major, minor, tiny, pre = version.split('.', 4) pre = pre ? pre.inspect : "nil" ruby.gsub!(/^(\s*)MAJOR(\s*)= .*?$/, "\\1MAJOR = #{major}") @@ -48,6 +49,7 @@ directory "pkg" task gem => %w(update_versions pkg) do cmd = "" cmd << "cd #{framework} && " unless framework == "rails" + cmd << "bundle exec rake package && " unless framework == "rails" cmd << "gem build #{gemspec} && mv #{framework}-#{version}.gem #{root}/pkg/" sh cmd end @@ -57,8 +59,6 @@ directory "pkg" sh "gem install #{gem}" end - task :prep_release => [:ensure_clean_state, :build] - task :push => :build do sh "gem push #{gem}" end @@ -109,7 +109,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\\|CHANGELOG'`.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 @@ -119,6 +119,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" @@ -135,5 +139,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 |