diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b5b470..66684d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - [#90](https://github.com/dblock/ruby-gem-release/pull/90): Publish the released changelog section as GitHub Release notes in the standard workflow instead of generated notes, read before any publication - [@dblock](https://github.com/dblock). - [#91](https://github.com/dblock/ruby-gem-release/pull/91): Accept an Intridea Next section with release notes but no contribution placeholder, rejecting a placeholder marked differently from the configured one - [@dblock](https://github.com/dblock). - [#92](https://github.com/dblock/ruby-gem-release/pull/92): Document manual recovery from the preserved bundle when the default branch advances during publication - [@dblock](https://github.com/dblock). +- [#93](https://github.com/dblock/ruby-gem-release/pull/93): Document disabling the local Bundler `release` tasks so the workflow is the only release path - [@dblock](https://github.com/dblock). - Your contribution here. ## 0.9.0 (2026/11/20) diff --git a/README.md b/README.md index adb5edf..7af5b9b 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ RubyGemRelease::Workflow::RubyGem.new( These defaults select the gemspec and repository, reject empty pending notes, prepare the changelog, publish to RubyGems and GitHub Releases, and increment the patch version for the next development iteration; pass `next_version: :minor` or `:major` to [increment another part](docs/workflow/ruby_gem.md#next-version). Dates use UTC. +If the Rakefile also installs the Bundler gem tasks, disable their local `release` tasks so maintainers cannot publish around the workflow; see [Bundler Release Tasks](docs/usage.md#bundler-release-tasks). + ### 2. Add the Release Workflow Add `.github/workflows/release.yml` using the [sample workflow](examples/.github/workflows/release.yml), replacing the Ruby version with your project's value: diff --git a/docs/usage.md b/docs/usage.md index 0ce1a62..aa03fc4 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -46,6 +46,19 @@ The package uses `GEMSPEC_PATH` or the only root gemspec. Repository, branch, an When adding project-specific release customizations, use optional `ruby-gem-release/rspec` helpers to test the real workflow in a disposable consumer repository and inspect its commits and release-managed files; see [Testing Custom Workflows](testing.md). +### Bundler Release Tasks + +Projects that load `bundler/gem_tasks` or call `Bundler::GemHelper.install_tasks` keep the Bundler `rake release` task, which builds, tags, and pushes locally, then publishes with the RubyGems credentials of whoever runs it. The `release:rubygem_push` and `release:source_control_push` tasks it depends on share the `release:` prefix with these tasks and can be run directly. To make the workflow the only release path, replace all three after Bundler installs them: + +```ruby +%w[release release:rubygem_push release:source_control_push].each do |name| + Rake::Task[name].clear + task(name) { abort "#{name} is disabled; releases run through GitHub Actions" } +end +``` + +`clear` also removes their prerequisites, so nothing is built or tagged before the task aborts. The Bundler `build` and `install` tasks remain available, and ruby-gem-release's `release:*` tasks are unaffected. + ## Object Overrides Override `package:`, `destination:`, `git:`, `hosting:`, or `provider:` without changing the sequence. For example, disable hosted releases while retaining RubyGems publication: