Repository navigation
Conversation
Member
|
Look good! |
Releases are cut by hand today: `rake release` pushes the gem with the maintainer's local RubyGems credentials, and a tag-triggered workflow creates the GitHub Release afterwards. ruby-gem-release moves publication into one manual workflow dispatch that authenticates with RubyGems Trusted Publishing, so no API key is stored in the repository or on a laptop. The same run updates the changelog, tags the release, creates the GitHub Release, and opens the next development version. The tag-triggered workflow is replaced because the new flow pushes the tag itself, and both would create the same GitHub Release. Local `rake release` now points to the workflow, so the gem cannot be published around it. The release tasks register only on Ruby 3.3+, so the Ruby 3.1 and 3.2 CI jobs still install the bundle.
The input declares the owner of a gem on its first publication. grape-swagger already exists on RubyGems and its owners are set, so the input has no effect and only adds a field to the dispatch form.
numbata
force-pushed
the
adopt-ruby-gem-release
branch
from
November 16, 2026 13:15
3fbe061 to
4388a1b
Compare
Danger ReportNo issues found. |
Member
|
@numbata finish this? |
The Release workflow writes changelog headings in the project's dash date format, which ruby-gem-release only accepts since dblock/ruby-gem-release#69. Pin the gem and the reusable release workflow to v0.8.0, the first release that includes it, and rewrite RELEASING.md for the workflow-based steps, which replace the Travis check and local rake release. v0.8.0 parses Markdown changelogs with Commonmarker, so the development bundle adds it alongside the gem.
There was a problem hiding this comment.
🟡 Changes recommended
The release workflow grants repository write access and gem-publishing credentials to code referenced by a mutable upstream tag, allowing tag changes to silently alter privileged release runs.
6 open issues
Pin the privileged release workflow to a commit SHA · New Preserve a required placeholder in the Next changelog section · New Document recovery for post-publication failures · New Guard Bundler's direct release subtasks · New Pass the prepared changelog as explicit GitHub Release notes · New Set the trusted publisher's workflow repository owner and name · New
What changed in this PR
This PR moves grape-swagger’s gem publication and release bookkeeping into a manually dispatched GitHub Actions workflow, replacing the split local-publishing and tag-triggered process.
Changes:
- Adopt the reusable ruby-gem-release workflow with RubyGems Trusted Publishing.
- Add Ruby 3.3+ release dependencies and tasks, and redirect local
rake releaseto the workflow. - Update release instructions and record the automation change in the changelog.
| File | Description |
|---|---|
| RELEASING.md | Documents workflow dispatch, approvals, and one-time publisher setup. |
| Rakefile | Configures release tasks and blocks the top-level local release command. |
| Gemfile | Adds release dependencies conditionally for Ruby 3.3 and newer. |
| CHANGELOG.md | Records the switch to manual release automation. |
| .github/workflows/release.yml | Replaces tag-triggered release creation with the reusable publishing workflow. |
Review effort: Max (adaptive)
This was referenced Nov 21, 2026
The reusable release workflow receives write access and an OIDC token that can publish the gem, and a version tag can be moved, so reference the v0.8.0 commit directly. Bundler's release:rubygem_push and release:source_control_push could still publish or tag from a laptop after only `release` was disabled, so disable all three. RELEASING.md now documents the setup and failure cases the workflow leaves to maintainers: the RubyGems workflow repository fields for a reusable workflow, keeping a changelog placeholder until the release, and not merging into master while a release runs.
The first release is also the first real exercise of Trusted Publishing, so the workflow now accepts a dry-run input that checks the release prerequisites without publishing. The changelog transformer is told which sections exist so an empty category is removed instead of being released as a bare heading. The changelog entry moves to Features, the Bundler task override tolerates a renamed task, and the Ruby 3.3 version guard in the Gemfile is written once.
The release workflow and the Rakefile integration use the same gem version, so both move together. 0.9.0 adds an optional `gemfile` input to the reusable workflow and changes nothing for the current setup.
… bundle A green dry run only proves Trusted Publishing and push permissions, and it waits for the same environment approval as a real run, so RELEASING.md now says both instead of implying the whole release was validated. The Rakefile loads the release tasks when ruby-gem-release is in the bundle rather than repeating the Ruby version check from the Gemfile, so the floor lives in one place. The Gemfile comment and the placeholder note name who is affected and when the note can go.
dblock
approved these changes
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Releasing grape-swagger currently means pushing the gem from a maintainer's machine and then relying on a tag-triggered workflow that only creates the GitHub Release. This change moves the whole release into one manual run of the Release workflow, which publishes the gem through RubyGems Trusted Publishing, updates the changelog, tags the release, and prepares the next version. Changelog headings keep the project's dash date format, so the changelog stays consistent with earlier releases. The GitHub Release body is generated by GitHub until the upstream release tooling can copy it from the changelog.
Root cause
The release steps are split across a local command and a tag-triggered workflow, and nothing checks that they happen in order. Publishing depends on the maintainer's local RubyGems credentials, and the version bump, changelog heading, and tag are done by hand. A missed step leaves the tag, the changelog, the gem, and the GitHub Release out of sync.
What changes
rake release,release:rubygem_push, andrelease:source_control_pushtasks now stop with a message that points to the workflow, so the usual ways of publishing from a laptop are closed.Drawbacks
dblock/ruby-gem-releasev0.9.0. Upgrading it means upgrading the gem and the pin together.releaseenvironment in GitHub.master.ruby-gem-releaseships its unreleased swagger-ui doesn't honor required parameters in optional group #90 and Empty field for group parameters' name with type hash or Array #91, the GitHub Release body is generated by GitHub instead of copied from the changelog section, and the Next section must keep at least one* Your contribution here.line. Both are merged upstream but not in 0.9.0, so they are expected in 0.10.0.ruby-gem-releaseandcommonmarker) that require Ruby 3.3 or newer. Contributors on Ruby 3.1 or 3.2 do not get the release tasks.Alternatives considered
rake releaseand the tag workflow. This is the status quo. It keeps the manual steps and the local credentials that this change removes.gemfileinput, with its own committed lock. It would pin the release dependencies and remove the Ruby 3.3 guard from the main Gemfile, but it adds a second dependency set to maintain, so it is left for a follow-up.