You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 57890ab
Browse filesBrowse the repository at this point in the historyBrowse files
Projects that keep `ruby-gem-release` and Commonmarker out of their main
bundle could not use the reusable workflow: overriding the commands was
not enough, because capture, resolution, checkpoint, preflight, and
failure-phase steps run `bundle exec rake release:workflow:*` in the
default bundle that `ruby/setup-ruby` installs. Add a `gemfile` input
that sets `BUNDLE_GEMFILE` for both jobs before Ruby setup, and an
equivalent composite-action input exported before setup.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011Gr21j6KD4oksnhmZ5u3pr
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,8 @@
1
1
# Changelog
2
2
3
-
## 0.8.1 (Next)
3
+
## 0.9.0 (Next)
4
4
5
+
-[#89](https://github.com/dblock/ruby-gem-release/pull/89): Add a `gemfile` input to the reusable workflow and composite action that selects the Gemfile every release step installs and runs in, so release-only gems can stay out of a project's main bundle - [@dblock](https://github.com/dblock).
Copy file name to clipboardExpand all lines: action.yml
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,9 @@ inputs:
12
12
gemspec:
13
13
description: Optional gemspec path; defaults to the only root gemspec.
14
14
default: ''
15
+
gemfile:
16
+
description: Optional Gemfile for Bundler, relative to the repository root; its lockfile must be committed or ignored. Empty keeps the job's BUNDLE_GEMFILE or Gemfile.
17
+
default: ''
15
18
rubygems-owner:
16
19
description: Optional RubyGems account ID for first publication with a pending trusted publisher.
17
20
default: ''
@@ -62,6 +65,15 @@ runs:
62
65
id: checkout
63
66
with:
64
67
fetch-depth: 0
68
+
- name: Select Gemfile
69
+
id: select_gemfile
70
+
if: ${{ inputs.gemfile != '' }}
71
+
shell: bash
72
+
env:
73
+
RELEASE_GEMFILE: ${{ inputs.gemfile }}
74
+
run: |
75
+
[[ "$RELEASE_GEMFILE" != *$'\n'* && "$RELEASE_GEMFILE" != *$'\r'* ]] || { echo 'gemfile must be a single line' >&2; exit 1; }
Copy file name to clipboardExpand all lines: docs/actions/action.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ The action checks out the calling repository with full history and sets up Ruby
48
48
49
49
## Inputs and Environment
50
50
51
-
Inputs, command defaults, callback semantics, and exported environment variables match the [workflow reference](release.md#inputs). Set them under the action step's `with:` mapping rather than under a reusable-workflow job. All action inputs are strings. Dispatching the sample workflow requests publication; configured environment protection rules must pass before the job runs.
51
+
Inputs, command defaults, callback semantics, and exported environment variables match the [workflow reference](release.md#inputs). Set them under the action step's `with:` mapping rather than under a reusable-workflow job. All action inputs are strings. `gemfile` defaults to empty, which keeps a `BUNDLE_GEMFILE` the calling job already sets; a nonempty value is exported for all later steps before Ruby setup. Dispatching the sample workflow requests publication; configured environment protection rules must pass before the job runs.
52
52
53
53
For [already-reviewed source and package collections](../workflow/reviewed_ruby_gem.md), configure `Workflow::ReviewedRubyGem` in the Rakefile. Optional `prepare-artifacts` prepares explicit input archives after Ruby setup, before loading release tasks for input configuration and capture; `artifacts` adds newline-separated paths to artifact preservation. Both default to empty. Caller-provided commands retain release privileges and must use reviewed inputs.
Copy file name to clipboardExpand all lines: docs/actions/release.md
+34-19Lines changed: 34 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,25 +10,26 @@ Every action the workflow uses is pinned to a commit SHA. RubyGems Trusted Publi
10
10
11
11
Set these under the calling job's `with:` mapping. Only `ruby-version` is required.
12
12
13
-
| Input | Type | Default | Behavior |
14
-
| --- | --- | --- | --- |
15
-
|`ruby-version`| String | Required | Ruby version used for validation and building. |
16
-
|`version`| String | Empty | Selected numeric `MAJOR.MINOR.PATCH` release version, without leading zeros. Overrides the checked-in version in standard preparation. |
17
-
|`gemspec`| String | Empty | Specification path, defaulting to the only root gemspec. Missing or ambiguous specifications fail. |
18
-
|`rubygems-owner`| String | Empty | Numeric RubyGems account ID required for a new gem's pending trusted publisher to create it. |
19
-
|`timezone`| String |`UTC`| Installed timezone identifier for the release calendar date and Git timestamp offsets. |
20
-
|`prepare-artifacts`| String | Empty | Trusted command preparing explicitly selected input archives after setup, before capture. |
|`validate`| String |`bundle exec rake release:validate`| Check release preconditions before edits; exit nonzero on failure. |
23
-
|`prepare`| String |`bundle exec rake release:prepare`| Prepare release files before version resolution and testing. |
24
-
|`test`| String |`bundle exec rake`| Test prepared release files before publication. |
25
-
|`publish`| String |`bundle exec rake release:publish`| Commit, build, tag, publish to RubyGems, push atomically, and create a GitHub Release through the configured callback. |
26
-
|`bump`| String |`bundle exec rake release:bump`| Prepare, commit, and push the next development iteration through the configured callback. |
27
-
|`success`| String |`bundle exec rake release:success`| Run after publication and the next development iteration succeed. |
28
-
|`failure`| String |`bundle exec rake release:failure`| Run after a release job failure, after Ruby setup. |
29
-
|`git-user-name`| String |`github-actions[bot]`| Checkout-local author name for release and next development iteration commits. |
30
-
|`git-user-email`| String |`github-actions[bot]@users.noreply.github.com`| Checkout-local author email for release and next development iteration commits. |
31
-
|`dry-run`| Boolean |`false`| Check release prerequisites, such as RubyGems Trusted Publishing, without editing files, pushing, or publishing. See [Dry Run](#dry-run). |
13
+
| Input | Type | Default | Behavior |
14
+
| --- | --- | --- | --- |
15
+
|`ruby-version`| String | Required | Ruby version used for validation and building. |
16
+
|`version`| String | Empty | Selected numeric `MAJOR.MINOR.PATCH` release version, without leading zeros. Overrides the checked-in version in standard preparation. |
17
+
|`gemspec`| String | Empty | Specification path, defaulting to the only root gemspec. Missing or ambiguous specifications fail. |
18
+
|`gemfile`| String |`Gemfile`| Gemfile Bundler installs and every release step runs in, set as `BUNDLE_GEMFILE` before Ruby setup. See [Release Gemfile](#release-gemfile). |
19
+
|`rubygems-owner`| String | Empty | Numeric RubyGems account ID required for a new gem's pending trusted publisher to create it. |
20
+
|`timezone`| String |`UTC`| Installed timezone identifier for the release calendar date and Git timestamp offsets. |
21
+
|`prepare-artifacts`| String | Empty | Trusted command preparing explicitly selected input archives after setup, before capture. |
|`validate`| String |`bundle exec rake release:validate`| Check release preconditions before edits; exit nonzero on failure. |
24
+
|`prepare`| String |`bundle exec rake release:prepare`| Prepare release files before version resolution and testing. |
25
+
|`test`| String |`bundle exec rake`| Test prepared release files before publication. |
26
+
|`publish`| String |`bundle exec rake release:publish`| Commit, build, tag, publish to RubyGems, push atomically, and create a GitHub Release through the configured callback. |
27
+
|`bump`| String |`bundle exec rake release:bump`| Prepare, commit, and push the next development iteration through the configured callback. |
28
+
|`success`| String |`bundle exec rake release:success`| Run after publication and the next development iteration succeed. |
29
+
|`failure`| String |`bundle exec rake release:failure`| Run after a release job failure, after Ruby setup. |
30
+
|`git-user-name`| String |`github-actions[bot]`| Checkout-local author name for release and next development iteration commits. |
31
+
|`git-user-email`| String |`github-actions[bot]@users.noreply.github.com`| Checkout-local author email for release and next development iteration commits. |
32
+
|`dry-run`| Boolean |`false`| Check release prerequisites, such as RubyGems Trusted Publishing, without editing files, pushing, or publishing. See [Dry Run](#dry-run). |
32
33
33
34
Identity values must be nonempty and contain no line breaks. They change commit attribution, not authentication or push permissions.
34
35
@@ -79,6 +80,20 @@ Expose a string `version` input in the caller's `workflow_dispatch` form and for
79
80
80
81
Custom preparation commands and callbacks must honor the selection; resolution rejects a mismatched prepared gemspec before publication. Custom version objects must implement `read`, `set!`, and `increment!`. See [UPGRADING.md](../../UPGRADING.md) for migrations.
81
82
83
+
### Release Gemfile
84
+
85
+
To keep `ruby-gem-release` and its optional dependencies out of every contributor's and CI variant's bundle, put them in a separate Gemfile that evaluates the main one, and pass it as `gemfile:`:
86
+
87
+
```ruby
88
+
# gemfiles/release.gemfile
89
+
eval_gemfile '../Gemfile'
90
+
91
+
gem 'commonmarker', '~> 2.10', require: false
92
+
gem 'ruby-gem-release', '0.9.0', require: false
93
+
```
94
+
95
+
The workflow sets `BUNDLE_GEMFILE` for the whole job before `ruby/setup-ruby` installs the bundle, so the built-in `bundle exec rake release:workflow:*` steps and the default commands, including the `test` command's full suite, run in that bundle. Commit or ignore the lockfile Bundler writes next to the selected Gemfile: capture rejects an untracked lockfile as an unclean checkout. Guard the release task setup in your Rakefile with `rescue LoadError` so the main bundle can still load it without the gem.
96
+
82
97
### Timezone
83
98
84
99
Set `timezone: America/New_York` under `with:` to use Eastern Time, including daylight saving changes. UTC remains the default.
0 commit comments