Skip to content

Commit

Permalink
Allow publishing only core
Browse files Browse the repository at this point in the history
  • Loading branch information
pitr-ch committed Nov 6, 2018
1 parent a18c5d0 commit 9fe401e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -283,28 +283,36 @@ namespace :release do
task :publish => ['publish:ask', 'publish:tag', 'publish:rubygems', 'publish:post_steps']

namespace :publish do
publish_edge = false

task :ask do
begin
STDOUT.puts 'Do you want to publish? (y/n)'
STDOUT.puts 'Do you want to publish anything? (y/n)'
input = STDIN.gets.strip.downcase
end until %w(y n).include?(input)
exit 1 if input == 'n'
begin
STDOUT.puts 'Do you want to publish edge? (y/n)'
input = STDIN.gets.strip.downcase
end until %w(y n).include?(input)
publish_edge = input == 'y'
end

desc '** tag HEAD with current version and push to github'
task :tag do
Dir.chdir(__dir__) do
sh "git tag v#{Concurrent::VERSION}"
sh "git tag edge-v#{Concurrent::EDGE_VERSION}"
sh "git push origin v#{Concurrent::VERSION} edge-v#{Concurrent::EDGE_VERSION}"
sh "git push origin v#{Concurrent::VERSION}"
sh "git tag edge-v#{Concurrent::EDGE_VERSION}" if publish_edge
sh "git push origin edge-v#{Concurrent::EDGE_VERSION}" if publish_edge
end
end

desc '** push all *.gem files to rubygems'
task :rubygems do
Dir.chdir(__dir__) do
sh "gem push pkg/concurrent-ruby-#{Concurrent::VERSION}.gem"
sh "gem push pkg/concurrent-ruby-edge-#{Concurrent::EDGE_VERSION}.gem"
sh "gem push pkg/concurrent-ruby-edge-#{Concurrent::EDGE_VERSION}.gem" if publish_edge
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}.gem"
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}-x64-mingw32.gem"
sh "gem push pkg/concurrent-ruby-ext-#{Concurrent::VERSION}-x86-mingw32.gem"
Expand Down

0 comments on commit 9fe401e

Please sign in to comment.