Skip to content

Commit

Permalink
fix: skip bump version with no label
Browse files Browse the repository at this point in the history
  • Loading branch information
iberianpig committed Oct 20, 2023
1 parent 4d7ec48 commit 457f962
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ desc "bump version and generate CHANGELOG with the version"
task :bump, :type do |_, args|
require "bump"
label = args[:type]
unless %w[major minor patch pre].include?(label)
raise "Usage: rake bump[LABEL] (LABEL: ['major', 'minor', 'patch', 'pre'])"
unless %w[major minor patch pre no].include?(label)
raise "Usage: rake bump[LABEL] (LABEL: ['major', 'minor', 'patch', 'pre', 'no'])"
end

next_version = Bump::Bump.next_version(label)
next_version = if label == "no"
Bump::Bump.current
else
Bump::Bump.next_version(label)
end

require "github_changelog_generator/task"
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
Expand All @@ -30,8 +34,14 @@ task :bump, :type do |_, args|
puts "update CHANGELOG"
`git add CHANGELOG.md`

puts "Bump version to #{label}"
Bump::Bump.run(label)
if label == "no"
puts "No bump version"
`git commit -m "update CHANGELOG"`
else
puts "Bump version to #{label}"
Bump::Bump.run(label)
end

puts 'Next step: "bundle exec rake release_tag"'
end

Expand Down

0 comments on commit 457f962

Please sign in to comment.