Skip to content

Commit 7bca8e5

Browse files
Automatically create release pull requests
1 parent 4251ae6 commit 7bca8e5

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

POLICIES.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@ Bundler:
6969

7070
* Confirm all PRs that you want backported are properly tagged with `rubygems:
7171
<type>` or `bundler: <type>` labels at GitHub.
72-
* Run `rake prepare_release[<target_version>]`, create a PR and merge it
73-
to the stable branch once CI passes.
74-
* Switch to the stable branch and pull the PR just merged.
72+
* Run `rake prepare_release[<target_version>]`. This will create a PR to the
73+
stable branch with the backports included in the release, and proper
74+
changelogs and version bumps. It will also create a PR to merge release
75+
changelogs into master.
76+
* Once CI passes, merge the release PR, switch to the stable branch and pull
77+
the PR just merged.
7578
* Release `bundler` with `(cd bundler && bin/rake release)`.
7679
* Release `rubygems` with `rake release`.
7780

util/release.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,32 @@ def prepare!
184184

185185
return if @level == :minor_or_major
186186

187+
system("git", "push", exception: true)
188+
189+
gh_client.create_pull_request(
190+
"rubygems/rubygems",
191+
@base_branch,
192+
@release_branch,
193+
"Prepare RubyGems #{@rubygems.version} and Bundler #{@bundler.version}",
194+
"It's release day!"
195+
)
196+
187197
system("git", "checkout", "-b", "cherry_pick_changelogs", "master", exception: true)
188198

189199
begin
190200
system("git", "cherry-pick", bundler_changelog, rubygems_changelog, exception: true)
201+
system("git", "push", exception: true)
191202
rescue StandardError
192203
system("git", "cherry-pick", "--abort")
193204
system("git", "branch", "-D", "cherry_pick_changelogs")
205+
else
206+
gh_client.create_pull_request(
207+
"rubygems/rubygems",
208+
"master",
209+
"cherry_pick_changelogs",
210+
"Changelogs for RubyGems #{@rubygems.version} and Bundler #{@bundler.version}",
211+
"Cherry-picking change logs from future RubyGems #{@rubygems.version} and Bundler #{@bundler.version} into master."
212+
)
194213
end
195214
rescue StandardError
196215
system("git", "checkout", initial_branch)

0 commit comments

Comments
 (0)