Skip to content

Commit dbd855d

Browse files
committed
Fix release task to commit version bump before gem release
The gem bump command modifies the version file but the --no-commit flag means it doesn't commit it. This causes gem release to fail because it expects a clean working directory. This commit adds git commands to stage and commit the version file after bumping but before releasing the gem.
1 parent 5e4041d commit dbd855d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rakelib/release.rake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ task :release, %i[gem_version dry_run] do |_t, args|
4242
sh_in_dir(gem_root, "git pull --rebase")
4343
sh_in_dir(gem_root, "gem bump --no-commit --file lib/cypress_on_rails/version.rb #{gem_version.strip.empty? ? '' : %(-v #{gem_version})}")
4444

45+
# Commit the version bump
46+
sh_in_dir(gem_root, "git add lib/cypress_on_rails/version.rb")
47+
sh_in_dir(gem_root, "git commit -m 'Bump version to #{gem_version}'")
48+
4549
# Release the new gem version
4650
puts "Carefully add your OTP for Rubygems. If you get an error, run 'gem release' again."
4751
sh_in_dir(gem_root, "gem release") unless is_dry_run

0 commit comments

Comments
 (0)