From 0c55a59df47459244f300d6198ea29448ab42890 Mon Sep 17 00:00:00 2001 From: Andrey Subbota Date: Thu, 12 Nov 2026 12:40:12 +0100 Subject: [PATCH 1/8] Adopt ruby-gem-release for gem releases 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. --- .github/workflows/release.yml | 51 +++++++++++------------------------ Gemfile | 2 ++ Rakefile | 17 ++++++++++++ 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a617b407e..927c2646f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,44 +1,25 @@ name: Release on: - push: - tags: - - 'v*' + workflow_dispatch: + inputs: + version: + description: Optional release version overriding the checked-in version. + type: string + required: false + rubygems-owner: + description: RubyGems account ID for first publication; omit for an existing gem. + type: string + required: false permissions: contents: write + id-token: write jobs: release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 0 - - name: Extract changelog - id: changelog - shell: bash - run: | - set -euo pipefail - tag="${GITHUB_REF_NAME}" - version="${tag#v}" - notes="$(awk -v version="$version" ' - $0 ~ "^### " version " " {found=1; next} - found && $0 ~ "^### " {exit} - found {print} - ' CHANGELOG.md)" - if [[ -z "${notes// }" ]]; then - echo "No changelog entry found for ${version}" >&2 - exit 1 - fi - { - echo "notes<> "$GITHUB_OUTPUT" - - name: Create GitHub release - uses: softprops/action-gh-release@v3 - with: - tag_name: ${{ github.ref_name }} - name: ${{ github.ref_name }} - body: ${{ steps.changelog.outputs.notes }} + uses: dblock/ruby-gem-release/.github/workflows/release.yml@v0.6.0 + with: + ruby-version: '3.4' + version: ${{ inputs.version }} + rubygems-owner: ${{ inputs.rubygems-owner }} diff --git a/Gemfile b/Gemfile index 4713afc3b..4da8ad5e1 100644 --- a/Gemfile +++ b/Gemfile @@ -43,6 +43,8 @@ group :development, :test do gem 'rdoc' gem 'rspec', '~> 3.9' gem 'rubocop', '~> 1.50', require: false + # ruby-gem-release requires Ruby 3.3+; older CI Rubies skip it. + gem 'ruby-gem-release', require: false if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0') unless ENV['MODEL_PARSER'] == 'grape-swagger-entity' gem 'grape-swagger-entity', git: 'https://github.com/ruby-grape/grape-swagger-entity' diff --git a/Rakefile b/Rakefile index 02c318ec0..5c321f57c 100644 --- a/Rakefile +++ b/Rakefile @@ -9,6 +9,23 @@ require 'rake' Bundler::GemHelper.install_tasks +# Publish only through the Release workflow, never a local push to rubygems.org. +Rake::Task['release'].clear +desc 'Publish through the Release workflow' +task :release do + abort 'Dispatch the Release workflow instead: gh workflow run release.yml' +end + +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0') + require 'ruby-gem-release/workflow/ruby_gem' + require 'ruby-gem-release/changelog' + + RubyGemRelease::Workflow::RubyGem.new( + version: RubyGemRelease::Version::RubyConstant.new(path: 'lib/grape-swagger/version.rb', constant: 'VERSION'), + changelog: RubyGemRelease::Changelog::Intridea.new(path: 'CHANGELOG.md', placeholder: '* Your contribution here.') + ).install_tasks +end + require 'rspec/core' require 'rspec/core/rake_task' From 4d517ffcca05231e8765af61d4cb0c8f4e16c0e7 Mon Sep 17 00:00:00 2001 From: Andrey Subbota Date: Thu, 12 Nov 2026 12:40:34 +0100 Subject: [PATCH 2/8] Add changelog entry for ruby-gem-release adoption --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f73adf529..159208988 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ #### Fixes +* [#1017](https://github.com/ruby-grape/grape-swagger/pull/1017): Release through the manual Release workflow with `ruby-gem-release` and RubyGems Trusted Publishing, replacing the tag-triggered GitHub Release workflow and local `rake release` - [@numbata](https://github.com/numbata). * [#905](https://github.com/ruby-grape/grape-swagger/pull/905): Allow Float, BigDecimal and beginless ranges in `values` to set `minimum` and `maximum`, and skip infinite bounds that cannot be serialized to JSON - [@artyomb](https://github.com/artyomb). * [#1016](https://github.com/ruby-grape/grape-swagger/pull/1016): Hide the nested parameters of a Hash parameter marked `documentation: { hidden: true }`, and pass the resolved `token_owner` to parameter-level `hidden:` procs like route-level ones (raising `TokenOwnerNotFound` if the configured method is missing) - [@numbata](https://github.com/numbata). * [#1013](https://github.com/ruby-grape/grape-swagger/pull/1013): Fix array `default` values being placed inside `items` instead of on the array parameter or property, and emit an empty array `default` - [@numbata](https://github.com/numbata). From 4388a1b0a892e5c65741c1400bb833c19142813c Mon Sep 17 00:00:00 2001 From: Andrey Subbota Date: Thu, 12 Nov 2026 14:36:26 +0100 Subject: [PATCH 3/8] Drop rubygems-owner input from the release workflow 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. --- .github/workflows/release.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 927c2646f..09239104e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,10 +7,6 @@ on: description: Optional release version overriding the checked-in version. type: string required: false - rubygems-owner: - description: RubyGems account ID for first publication; omit for an existing gem. - type: string - required: false permissions: contents: write @@ -22,4 +18,3 @@ jobs: with: ruby-version: '3.4' version: ${{ inputs.version }} - rubygems-owner: ${{ inputs.rubygems-owner }} From fd3ce26d0561b10c631f596055c215ce319f1a00 Mon Sep 17 00:00:00 2001 From: Andrey Subbota Date: Sat, 21 Nov 2026 00:45:01 +0100 Subject: [PATCH 4/8] Pin ruby-gem-release to v0.8.0 and release with dash dates 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. --- .github/workflows/release.yml | 2 +- Gemfile | 3 +- RELEASING.md | 61 ++++++++++------------------------- Rakefile | 4 ++- 4 files changed, 23 insertions(+), 47 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 09239104e..4fdf21d4b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ permissions: jobs: release: - uses: dblock/ruby-gem-release/.github/workflows/release.yml@v0.6.0 + uses: dblock/ruby-gem-release/.github/workflows/release.yml@v0.8.0 with: ruby-version: '3.4' version: ${{ inputs.version }} diff --git a/Gemfile b/Gemfile index 4da8ad5e1..801d5169f 100644 --- a/Gemfile +++ b/Gemfile @@ -44,7 +44,8 @@ group :development, :test do gem 'rspec', '~> 3.9' gem 'rubocop', '~> 1.50', require: false # ruby-gem-release requires Ruby 3.3+; older CI Rubies skip it. - gem 'ruby-gem-release', require: false if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0') + gem 'commonmarker', '~> 2.10', require: false if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0') + gem 'ruby-gem-release', '0.8.0', require: false if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0') unless ENV['MODEL_PARSER'] == 'grape-swagger-entity' gem 'grape-swagger-entity', git: 'https://github.com/ruby-grape/grape-swagger-entity' diff --git a/RELEASING.md b/RELEASING.md index c8208db65..af2f6252c 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -4,67 +4,40 @@ There are no particular rules about when to release grape-swagger. Any co-mainta ### Release -Run tests, check that all tests succeed locally. +Run tests locally and make sure they pass. ``` bundle install rake ``` -Check that the last build succeeded in [Travis CI](https://travis-ci.org/ruby-grape/grape-swagger) for all supported platforms. +Make sure the "Next" section in [CHANGELOG.md](CHANGELOG.md) lists the changes for the release. A release with only placeholder notes is refused. -Change "Next" in [CHANGELOG.md](CHANGELOG.md) to the current date. +Dispatch the Release workflow from the `master` branch, either from the Actions tab or from the command line. Leave `version` empty to release the version in [lib/grape-swagger/version.rb](lib/grape-swagger/version.rb). ``` -### 2.2.0 (2025-11-21) +gh workflow run release.yml ``` -Remove the lines with "Your contribution here.", since there will be no more contributions to this release. +The workflow: -Commit your changes. +- Validates the release and builds the gem. +- Publishes the gem to RubyGems through Trusted Publishing, so no API key is needed. +- Changes "Next" in [CHANGELOG.md](CHANGELOG.md) to the release version and the current date, and removes the "Your contribution here." lines. +- Tags the release, creates the GitHub Release, and pushes the commit to `master`. +- Bumps the version and opens the next "Next" section in [CHANGELOG.md](CHANGELOG.md). -``` -git add CHANGELOG.md lib/grape-swagger/version.rb -git commit -m "Preparing for release, 2.2.0." -git push origin master -``` +Do not run `rake release` locally. It stops with a message that points to the workflow. -Release. +The `release` environment in GitHub requires an approval before the workflow publishes. Maintainers listed as reviewers approve the run. -``` -$ rake release - -grape-swagger 2.2.0 built to pkg/grape-swagger-2.2.0.gem. -Tagged v2.2.0. -Pushed git commits and tags. -Pushed grape-swagger 2.2.0 to rubygems.org. -``` +### One-time Setup -### Prepare for the Next Version - -Increment the minor version, the third number, modify [lib/grape-swagger/version.rb](lib/grape-swagger/version.rb). For example, change `0.7.1` to `0.7.2`. Major versions are incremented in pull requests that require it. - -Add the next release to [CHANGELOG.md](CHANGELOG.md). - -``` -### 2.2.1 (Next) +Maintainers set these up once before the first release: -#### Features - -* Your contribution here. - -#### Fixes - -* Your contribution here. -``` - -Commit your changes. - -``` -git add CHANGELOG.md lib/grape-swagger/version.rb -git commit -m "Preparing for next developer iteration, 2.2.1." -git push origin master -``` +- A RubyGems trusted publisher for `grape-swagger` that points to `ruby-grape/grape-swagger`, the `release.yml` workflow, and the `release` environment. +- A `release` environment in the repository settings, with required reviewers and a deployment branch rule that only allows `master`. +- Permission for the Actions token to push the release commit and tag to `master`. ### Make an Announcement diff --git a/Rakefile b/Rakefile index 5c321f57c..27ce1b647 100644 --- a/Rakefile +++ b/Rakefile @@ -22,7 +22,9 @@ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0') RubyGemRelease::Workflow::RubyGem.new( version: RubyGemRelease::Version::RubyConstant.new(path: 'lib/grape-swagger/version.rb', constant: 'VERSION'), - changelog: RubyGemRelease::Changelog::Intridea.new(path: 'CHANGELOG.md', placeholder: '* Your contribution here.') + changelog: RubyGemRelease::Changelog::Intridea.new( + path: 'CHANGELOG.md', placeholder: '* Your contribution here.', date_format: '%Y-%m-%d' + ) ).install_tasks end From cfe91d55f1d21e0d01116f6e4d106374ca5c319a Mon Sep 17 00:00:00 2001 From: Andrey Subbota Date: Sat, 21 Nov 2026 16:54:05 +0100 Subject: [PATCH 5/8] Pin the release workflow to a commit and disable all local release tasks 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. --- .github/workflows/release.yml | 2 +- RELEASING.md | 10 +++++++--- Rakefile | 10 +++++----- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4fdf21d4b..e3d879714 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ permissions: jobs: release: - uses: dblock/ruby-gem-release/.github/workflows/release.yml@v0.8.0 + uses: dblock/ruby-gem-release/.github/workflows/release.yml@af40fdfc7a55a7d0577cacc042b2baf952f64e4f # v0.8.0 with: ruby-version: '3.4' version: ${{ inputs.version }} diff --git a/RELEASING.md b/RELEASING.md index af2f6252c..f554ed9ef 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -11,7 +11,7 @@ bundle install rake ``` -Make sure the "Next" section in [CHANGELOG.md](CHANGELOG.md) lists the changes for the release. A release with only placeholder notes is refused. +Make sure the "Next" section in [CHANGELOG.md](CHANGELOG.md) lists the changes for the release. A release with only placeholder notes is refused. Keep at least one `* Your contribution here.` line in the section, because the workflow removes the placeholder lines and refuses a section that has none. Dispatch the Release workflow from the `master` branch, either from the Actions tab or from the command line. Leave `version` empty to release the version in [lib/grape-swagger/version.rb](lib/grape-swagger/version.rb). @@ -27,15 +27,19 @@ The workflow: - Tags the release, creates the GitHub Release, and pushes the commit to `master`. - Bumps the version and opens the next "Next" section in [CHANGELOG.md](CHANGELOG.md). -Do not run `rake release` locally. It stops with a message that points to the workflow. +The local Bundler release tasks (`rake release`, `release:rubygem_push`, and `release:source_control_push`) are disabled. They stop with a message that points to the workflow. The `release` environment in GitHub requires an approval before the workflow publishes. Maintainers listed as reviewers approve the run. +### If a Release Fails + +Do not merge anything into `master` while a release runs. If `master` moves before the gem is published, the release stops safely and a new dispatch starts clean. If it moves after publication, the gem is on RubyGems but the push fails with `Default branch advanced; start a new release`, leaving no tag, release commit, GitHub Release, or next version, and a new dispatch does not repair that. Recover from the artifacts the run preserved, following [Default Branch Advanced During Publication](https://github.com/dblock/ruby-gem-release/blob/master/docs/actions/release.md#default-branch-advanced-during-publication) in the ruby-gem-release documentation. + ### One-time Setup Maintainers set these up once before the first release: -- A RubyGems trusted publisher for `grape-swagger` that points to `ruby-grape/grape-swagger`, the `release.yml` workflow, and the `release` environment. +- A RubyGems trusted publisher for `grape-swagger` that points to `ruby-grape/grape-swagger`, the `release.yml` workflow, and the `release` environment. The workflow is a reusable one, so also set the separate workflow repository owner and name fields to `dblock` and `ruby-gem-release`. - A `release` environment in the repository settings, with required reviewers and a deployment branch rule that only allows `master`. - Permission for the Actions token to push the release commit and tag to `master`. diff --git a/Rakefile b/Rakefile index 27ce1b647..55274b827 100644 --- a/Rakefile +++ b/Rakefile @@ -9,11 +9,11 @@ require 'rake' Bundler::GemHelper.install_tasks -# Publish only through the Release workflow, never a local push to rubygems.org. -Rake::Task['release'].clear -desc 'Publish through the Release workflow' -task :release do - abort 'Dispatch the Release workflow instead: gh workflow run release.yml' +# Disable Bundler's local release tasks so the Release workflow is the only release path. +# `clear` also drops their prerequisites, so nothing is built or tagged before the abort. +%w[release release:rubygem_push release:source_control_push].each do |name| + Rake::Task[name].clear + task(name) { abort "#{name} is disabled; dispatch the Release workflow instead: gh workflow run release.yml" } end if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0') From 16fcba69b6b4647ed5a5913bc46c0357485851f2 Mon Sep 17 00:00:00 2001 From: Andrey Subbota Date: Mon, 23 Nov 2026 22:45:57 +0100 Subject: [PATCH 6/8] Expose a release dry run and drop empty changelog sections 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. --- .github/workflows/release.yml | 5 +++++ CHANGELOG.md | 2 +- Gemfile | 9 ++++++--- RELEASING.md | 2 ++ Rakefile | 5 +++-- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e3d879714..3ab0acaea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,10 @@ on: description: Optional release version overriding the checked-in version. type: string required: false + dry-run: + description: Check the release prerequisites without publishing. + type: boolean + default: false permissions: contents: write @@ -18,3 +22,4 @@ jobs: with: ruby-version: '3.4' version: ${{ inputs.version }} + dry-run: ${{ inputs.dry-run }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 159208988..b80a7d1aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,11 @@ #### Features +* [#1017](https://github.com/ruby-grape/grape-swagger/pull/1017): Release through the manual Release workflow with `ruby-gem-release` and RubyGems Trusted Publishing, replacing the tag-triggered GitHub Release workflow and local `rake release` - [@numbata](https://github.com/numbata). * Your contribution here. #### Fixes -* [#1017](https://github.com/ruby-grape/grape-swagger/pull/1017): Release through the manual Release workflow with `ruby-gem-release` and RubyGems Trusted Publishing, replacing the tag-triggered GitHub Release workflow and local `rake release` - [@numbata](https://github.com/numbata). * [#905](https://github.com/ruby-grape/grape-swagger/pull/905): Allow Float, BigDecimal and beginless ranges in `values` to set `minimum` and `maximum`, and skip infinite bounds that cannot be serialized to JSON - [@artyomb](https://github.com/artyomb). * [#1016](https://github.com/ruby-grape/grape-swagger/pull/1016): Hide the nested parameters of a Hash parameter marked `documentation: { hidden: true }`, and pass the resolved `token_owner` to parameter-level `hidden:` procs like route-level ones (raising `TokenOwnerNotFound` if the configured method is missing) - [@numbata](https://github.com/numbata). * [#1013](https://github.com/ruby-grape/grape-swagger/pull/1013): Fix array `default` values being placed inside `items` instead of on the array parameter or property, and emit an empty array `default` - [@numbata](https://github.com/numbata). diff --git a/Gemfile b/Gemfile index 801d5169f..f10758174 100644 --- a/Gemfile +++ b/Gemfile @@ -43,9 +43,6 @@ group :development, :test do gem 'rdoc' gem 'rspec', '~> 3.9' gem 'rubocop', '~> 1.50', require: false - # ruby-gem-release requires Ruby 3.3+; older CI Rubies skip it. - gem 'commonmarker', '~> 2.10', require: false if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0') - gem 'ruby-gem-release', '0.8.0', require: false if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0') unless ENV['MODEL_PARSER'] == 'grape-swagger-entity' gem 'grape-swagger-entity', git: 'https://github.com/ruby-grape/grape-swagger-entity' @@ -65,3 +62,9 @@ group :test do gem 'simplecov', require: false gem 'super_diff', require: false end + +# ruby-gem-release requires Ruby 3.3+; older CI Rubies skip it. +if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0') + gem 'commonmarker', '~> 2.10', require: false + gem 'ruby-gem-release', '0.8.0', require: false +end diff --git a/RELEASING.md b/RELEASING.md index f554ed9ef..b4cdc6194 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -43,6 +43,8 @@ Maintainers set these up once before the first release: - A `release` environment in the repository settings, with required reviewers and a deployment branch rule that only allows `master`. - Permission for the Actions token to push the release commit and tag to `master`. +Then dispatch the Release workflow once with `dry-run` enabled (`gh workflow run release.yml -f dry-run=true`). It checks the prerequisites, including Trusted Publishing, without publishing anything. + ### Make an Announcement Make an announcement on the [ruby-grape@googlegroups.com](mailto:ruby-grape@googlegroups.com) mailing list. The general format is as follows. diff --git a/Rakefile b/Rakefile index 55274b827..6951a98d0 100644 --- a/Rakefile +++ b/Rakefile @@ -12,7 +12,7 @@ Bundler::GemHelper.install_tasks # Disable Bundler's local release tasks so the Release workflow is the only release path. # `clear` also drops their prerequisites, so nothing is built or tagged before the abort. %w[release release:rubygem_push release:source_control_push].each do |name| - Rake::Task[name].clear + Rake::Task[name].clear if Rake::Task.task_defined?(name) task(name) { abort "#{name} is disabled; dispatch the Release workflow instead: gh workflow run release.yml" } end @@ -23,7 +23,8 @@ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0') RubyGemRelease::Workflow::RubyGem.new( version: RubyGemRelease::Version::RubyConstant.new(path: 'lib/grape-swagger/version.rb', constant: 'VERSION'), changelog: RubyGemRelease::Changelog::Intridea.new( - path: 'CHANGELOG.md', placeholder: '* Your contribution here.', date_format: '%Y-%m-%d' + path: 'CHANGELOG.md', placeholder: '* Your contribution here.', date_format: '%Y-%m-%d', + sections: %w[Features Fixes] ) ).install_tasks end From 87c9f90c45f245ec82e54e82a70a24a7247240ad Mon Sep 17 00:00:00 2001 From: Andrey Subbota Date: Wed, 25 Nov 2026 02:05:39 +0100 Subject: [PATCH 7/8] Bump ruby-gem-release to 0.9.0 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. --- .github/workflows/release.yml | 2 +- Gemfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3ab0acaea..9ee63f34c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ permissions: jobs: release: - uses: dblock/ruby-gem-release/.github/workflows/release.yml@af40fdfc7a55a7d0577cacc042b2baf952f64e4f # v0.8.0 + uses: dblock/ruby-gem-release/.github/workflows/release.yml@fc9b2673899047f7cb021e4c7f6528d819d06f77 # v0.9.0 with: ruby-version: '3.4' version: ${{ inputs.version }} diff --git a/Gemfile b/Gemfile index f10758174..6ec84bf42 100644 --- a/Gemfile +++ b/Gemfile @@ -66,5 +66,5 @@ end # ruby-gem-release requires Ruby 3.3+; older CI Rubies skip it. if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0') gem 'commonmarker', '~> 2.10', require: false - gem 'ruby-gem-release', '0.8.0', require: false + gem 'ruby-gem-release', '0.9.0', require: false end From 7bec8069b53738ce057a934ccaefdce275ff724a Mon Sep 17 00:00:00 2001 From: Andrey Subbota Date: Wed, 25 Nov 2026 07:54:01 +0100 Subject: [PATCH 8/8] Document what the release dry run checks and key the Rakefile off the 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. --- Gemfile | 2 +- RELEASING.md | 4 ++-- Rakefile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 6ec84bf42..3f491a968 100644 --- a/Gemfile +++ b/Gemfile @@ -63,7 +63,7 @@ group :test do gem 'super_diff', require: false end -# ruby-gem-release requires Ruby 3.3+; older CI Rubies skip it. +# ruby-gem-release requires Ruby 3.3+; older CI Rubies and contributors on Ruby 3.1 or 3.2 skip it. if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0') gem 'commonmarker', '~> 2.10', require: false gem 'ruby-gem-release', '0.9.0', require: false diff --git a/RELEASING.md b/RELEASING.md index b4cdc6194..27d228295 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -11,7 +11,7 @@ bundle install rake ``` -Make sure the "Next" section in [CHANGELOG.md](CHANGELOG.md) lists the changes for the release. A release with only placeholder notes is refused. Keep at least one `* Your contribution here.` line in the section, because the workflow removes the placeholder lines and refuses a section that has none. +Make sure the "Next" section in [CHANGELOG.md](CHANGELOG.md) lists the changes for the release. A release with only placeholder notes is refused. Keep at least one `* Your contribution here.` line in the section (until ruby-gem-release includes #90 and #91), because the workflow removes the placeholder lines and refuses a section that has none. Dispatch the Release workflow from the `master` branch, either from the Actions tab or from the command line. Leave `version` empty to release the version in [lib/grape-swagger/version.rb](lib/grape-swagger/version.rb). @@ -43,7 +43,7 @@ Maintainers set these up once before the first release: - A `release` environment in the repository settings, with required reviewers and a deployment branch rule that only allows `master`. - Permission for the Actions token to push the release commit and tag to `master`. -Then dispatch the Release workflow once with `dry-run` enabled (`gh workflow run release.yml -f dry-run=true`). It checks the prerequisites, including Trusted Publishing, without publishing anything. +Then dispatch the Release workflow once with `dry-run` enabled (`gh workflow run release.yml -f dry-run=true`). It checks Trusted Publishing and the token's push permissions without publishing anything, and waits for the same `release` environment approval as a real run. It does not validate the changelog, so a green dry run does not guarantee the real run passes. ### Make an Announcement diff --git a/Rakefile b/Rakefile index 6951a98d0..7ebee7304 100644 --- a/Rakefile +++ b/Rakefile @@ -16,7 +16,7 @@ Bundler::GemHelper.install_tasks task(name) { abort "#{name} is disabled; dispatch the Release workflow instead: gh workflow run release.yml" } end -if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3.0') +if Gem.loaded_specs.key?('ruby-gem-release') require 'ruby-gem-release/workflow/ruby_gem' require 'ruby-gem-release/changelog'