-
-
Notifications
You must be signed in to change notification settings - Fork 62
Fix release task to commit version bump before gem release (#???) #195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,11 +40,32 @@ task :release, %i[gem_version dry_run] do |_t, args| | |
|
|
||
| # See https://github.com/svenfuchs/gem-release | ||
| sh_in_dir(gem_root, "git pull --rebase") | ||
| sh_in_dir(gem_root, "gem bump --no-commit --file lib/cypress_on_rails/version.rb #{gem_version.strip.empty? ? '' : %(-v #{gem_version})}") | ||
| sh_in_dir(gem_root, "gem bump --no-commit --file lib/cypress_on_rails/version.rb #{gem_version.strip.empty? ? '' : %(--version #{gem_version})}") | ||
|
|
||
| # Release the new gem version | ||
| puts "Carefully add your OTP for Rubygems. If you get an error, run 'gem release' again." | ||
| sh_in_dir(gem_root, "gem release") unless is_dry_run | ||
| # Read the actual version from the file after bump | ||
| require_relative "../lib/cypress_on_rails/version" | ||
| actual_version = CypressOnRails::VERSION | ||
|
|
||
| # Update Gemfile.lock files | ||
| sh_in_dir(gem_root, "bundle install") | ||
|
|
||
| unless is_dry_run | ||
| # Commit the version bump and Gemfile.lock update | ||
| sh_in_dir(gem_root, "git add lib/cypress_on_rails/version.rb Gemfile.lock") | ||
| sh_in_dir(gem_root, "git commit -m \"Release v#{actual_version}\"") | ||
|
|
||
| # Tag the release | ||
| sh_in_dir(gem_root, "git tag v#{actual_version}") | ||
|
|
||
| # Push the commit and tag | ||
| sh_in_dir(gem_root, "git push && git push --tags") | ||
|
|
||
| # Release the new gem version | ||
| puts "Carefully add your OTP for Rubygems. If you get an error, run 'gem release' again." | ||
| sh_in_dir(gem_root, "gem release") | ||
| else | ||
| puts "DRY RUN: Would have committed, tagged v#{actual_version}, pushed, and released gem" | ||
|
||
| end | ||
|
|
||
| msg = <<~MSG | ||
| Once you have successfully published, run these commands to update CHANGELOG.md: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.