Skip to content

Commit b453c49

Browse files
justin808claude
andauthored
Fix gem bump to properly update version (#188)
* Add simplified gem release process This commit adds a streamlined release process for the cypress-on-rails gem, removing the npm package release steps that were present in the react_on_rails version. Key changes: - Add lib/tasks/release.rake with gem-only release automation - Add docs/RELEASE.md with comprehensive release documentation - Simplify process by removing release-it and npm publishing steps - Keep essential features: version bumping, git tagging, and gem publishing The release task handles: - Checking for uncommitted changes - Pulling latest changes - Bumping version using gem-release - Publishing to RubyGems with OTP support - Providing post-release instructions for CHANGELOG updates 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix gem bump to properly update version The previous implementation used --no-commit which prevented gem bump from properly updating the version. Now gem bump will: - Update the version in lib/cypress_on_rails/version.rb - Create a commit with the version change - Create a git tag (e.g., v1.19.0) Then the task explicitly pushes the commit and tags before publishing to RubyGems. This matches the standard gem-release workflow. Also added --skip-ci flag to prevent CI from running on version bumps. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent a28e3d6 commit b453c49

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

docs/RELEASE.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,13 @@ The release task automates the following steps:
8484

8585
1. Checks for uncommitted changes (will abort if found)
8686
2. Pulls the latest changes from the repository
87-
3. Bumps the version number in `lib/cypress_on_rails/version.rb`
88-
4. Creates a git commit with the version bump
89-
5. Creates a git tag for the new version
90-
6. Pushes the commit and tag to GitHub
91-
7. Builds the gem
92-
8. Publishes the gem to RubyGems
87+
3. Bumps the version number in `lib/cypress_on_rails/version.rb` using `gem bump`
88+
4. Creates a git commit with the version bump message
89+
5. Creates a git tag for the new version (e.g., `v1.19.0`)
90+
6. Pushes the commit to GitHub
91+
7. Pushes the tag to GitHub
92+
8. Builds the gem
93+
9. Publishes the gem to RubyGems (requires OTP)
9394

9495
## Troubleshooting
9596

lib/tasks/release.rake

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,19 @@ task :release, %i[gem_version dry_run] do |_t, args|
3232

3333
# See https://github.com/svenfuchs/gem-release
3434
sh_in_dir(gem_root, "git pull --rebase")
35-
sh_in_dir(gem_root, "gem bump --no-commit #{%(--version #{gem_version}) unless gem_version.strip.empty?}")
3635

37-
# Release the new gem version
38-
puts "Carefully add your OTP for Rubygems. If you get an error, run 'gem release' again."
36+
# Bump version, commit, and tag (gem bump does all of this)
37+
bump_command = "gem bump"
38+
bump_command << " --version #{gem_version}" unless gem_version.strip.empty?
39+
bump_command << " --skip-ci" # Skip CI on version bump commit
40+
sh_in_dir(gem_root, bump_command)
41+
42+
# Push the commit and tag
43+
sh_in_dir(gem_root, "git push") unless is_dry_run
44+
sh_in_dir(gem_root, "git push --tags") unless is_dry_run
45+
46+
# Release the new gem version to RubyGems
47+
puts "\nCarefully add your OTP for Rubygems. If you get an error, run 'gem release' again."
3948
sh_in_dir(gem_root, "gem release") unless is_dry_run
4049

4150
msg = <<~MSG

0 commit comments

Comments
 (0)