Skip to content

Commit

Permalink
Add a prepare_release
Browse files Browse the repository at this point in the history
Based on code by @bastelfreak
  • Loading branch information
ekohl committed Dec 18, 2017
1 parent fd8f279 commit 196a4ee
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/voxpupuli/release/rake_tasks.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
desc 'Prepare a new release'
task :prepare_release, [:version] do |t, args|
unless args[:version]
puts 'you need to provide a version like: rake prepare_release[1.0.0]'
exit
end

version = args[:version]
if ['major', 'minor', 'patch'].include?(version)
bump_task = "module:bump:#{version}"
elsif /^\d+\.\d+\.\d+$/.match(version)
bump_task = 'module:bump:full'
ENV['BLACKSMITH_FULL_VERSION'] = version
else
puts 'Version needs to be major, minor, patch or in the X.X.X format'
exit
end

Rake::Task[bump_task].invoke
Rake::Task['changelog'].invoke
end

desc 'release new version through Travis-ci'
task "travis_release" do
Expand Down

0 comments on commit 196a4ee

Please sign in to comment.