-
Notifications
You must be signed in to change notification settings - Fork 69
Automate release #278
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
Automate release #278
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #278 +/- ##
=======================================
Coverage 98.46% 98.46%
=======================================
Files 20 20
Lines 717 717
Branches 178 178
=======================================
Hits 706 706
Misses 11 11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR automates the gem release process for rspec-openapi by introducing a GitHub Actions workflow that handles version bumping, git operations, RubyGems publishing via trusted publishing, and GitHub release creation. This addresses issue #277 by replacing the manual release process with an automated workflow.
Key Changes:
- Adds new GitHub Actions
releaseworkflow triggered manually viaworkflow_dispatchwith version input - Updates README documentation to describe the new automated release process
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
.github/workflows/push_gem.yml |
New workflow that automates version bumping, validation, git commits, RubyGems publishing, and GitHub release creation |
README.md |
Updates release instructions to reference the new automated workflow instead of manual steps |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| unless new_version < current_version | ||
| warn "Given version (#{new_version}) must be lower than current version (#{current_version})" |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version comparison logic is inverted. The condition should check if new_version > current_version (using > operator), not <. Currently it requires the new version to be lower than the current version, which prevents version bumps. This will cause all release attempts to fail.
| unless new_version < current_version | |
| warn "Given version (#{new_version}) must be lower than current version (#{current_version})" | |
| unless new_version > current_version | |
| warn "Given version (#{new_version}) must be greater than current version (#{current_version})" |
| unless new_version < current_version | ||
| warn "Given version (#{new_version}) must be lower than current version (#{current_version})" |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message is incorrect. It states "must be lower than" when it should state "must be greater than" to match the intended behavior of a version bump.
| unless new_version < current_version | |
| warn "Given version (#{new_version}) must be lower than current version (#{current_version})" | |
| unless new_version > current_version | |
| warn "Given version (#{new_version}) must be greater than current version (#{current_version})" |
| end | ||
| RUBY | ||
| ruby -pi -e "sub(/VERSION = .*/, \"VERSION = '$version'\")" lib/rspec/openapi/version.rb |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The string substitution doesn't preserve the quotes around the version string. The regex replacement should be "VERSION = '\\$version'" (with single quotes around $version) to match the existing format in version.rb which uses VERSION = '0.21.2'.
| ruby -pi -e "sub(/VERSION = .*/, \"VERSION = '$version'\")" lib/rspec/openapi/version.rb | |
| ruby -pi -e "sub(/VERSION = '.*'/, \"VERSION = '$version'\")" lib/rspec/openapi/version.rb |
| 3. Push tag | ||
| 1. Ensure RubyGems trusted publishing is configured for this repo and gem ownership (see [Trusted publishing](https://guides.rubygems.org/trusted-publishing/)). | ||
| 2. In GitHub Actions, run the `release` workflow manually and input the new version (`0.21.x` or `v0.21.x`). | ||
| 3. The workflow bumps `lib/rspec/openapi/version.rb`, pushes the change to the default branch, publishes to RubyGems via `rubygems/release-gem`, and creates a GitHub release with autogenerated notes. |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change "autogenerated" to "auto-generated" (hyphenated) for proper spelling.
| 3. The workflow bumps `lib/rspec/openapi/version.rb`, pushes the change to the default branch, publishes to RubyGems via `rubygems/release-gem`, and creates a GitHub release with autogenerated notes. | |
| 3. The workflow bumps `lib/rspec/openapi/version.rb`, pushes the change to the default branch, publishes to RubyGems via `rubygems/release-gem`, and creates a GitHub release with auto-generated notes. |
|
|
||
| permissions: | ||
| id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
| contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment references "rake release" but the workflow actually uses rubygems/release-gem@v1 (line 68). Update the comment to match the actual implementation, e.g., "IMPORTANT: this permission is required for pushing commits and creating tags".
| contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag | |
| contents: write # IMPORTANT: this permission is required for pushing commits and creating tags |
To prevent issues like #277