Skip to content

Commit f16e16a

Browse files
dblockclaude
andcommitted
Document disabling local Bundler release tasks
Projects that install the Bundler gem tasks keep rake release and its release:rubygem_push and release:source_control_push tasks, which publish with local credentials around the workflow. Document a tested snippet that replaces all three with tasks that abort, without prerequisites and without affecting ruby-gem-release tasks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Gr21hZDQo5axDMuFgzL6s
1 parent b8fbd31 commit f16e16a

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- [#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).
66
- [#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).
77
- [#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).
8+
- [#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).
89
- Your contribution here.
910

1011
## 0.9.0 (2026/11/20)

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ RubyGemRelease::Workflow::RubyGem.new(
2828

2929
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.
3030

31+
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).
32+
3133
### 2. Add the Release Workflow
3234

3335
Add `.github/workflows/release.yml` using the [sample workflow](examples/.github/workflows/release.yml), replacing the Ruby version with your project's value:

‎docs/usage.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ The package uses `GEMSPEC_PATH` or the only root gemspec. Repository, branch, an
4646

4747
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).
4848

49+
### Bundler Release Tasks
50+
51+
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:
52+
53+
```ruby
54+
%w[release release:rubygem_push release:source_control_push].each do |name|
55+
Rake::Task[name].clear
56+
task(name) { abort "#{name} is disabled; releases run through GitHub Actions" }
57+
end
58+
```
59+
60+
`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.
61+
4962
## Object Overrides
5063

5164
Override `package:`, `destination:`, `git:`, `hosting:`, or `provider:` without changing the sequence. For example, disable hosted releases while retaining RubyGems publication:

0 commit comments

Comments
 (0)