summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/playbooks/RELEASING.md18
-rw-r--r--task/release.rake29
2 files changed, 34 insertions, 13 deletions
diff --git a/doc/playbooks/RELEASING.md b/doc/playbooks/RELEASING.md
index 3eca974b6e..9cfdeda58b 100644
--- a/doc/playbooks/RELEASING.md
+++ b/doc/playbooks/RELEASING.md
@@ -54,12 +54,17 @@ The `rake release:patch` command will automatically handle cherry-picking, and i
Bundler maintains a list of changes present in each version in the `CHANGELOG.md` file.
Entries should not be added in pull requests, but are rather written by the Bundler
-maintainers in the [bundler-changelog repo](https://github.com/bundler/bundler-changelog).
-That repository tracks changes by pull requests, with each entry having an associated version,
-PR, section, author(s), issue(s) closed, and message.
+maintainers before the release.
-Ensure that repo has been updated with all new PRs before releasing a new version,
-and copy over the new sections to the `CHANGELOG.md` in the Bundler repo.
+To fill in the changelog, maintainers can go through the relevant PRs using the
+`rake release:open_unreleased_prs` and manually add a changelog entry for each
+PR that it's about to be released.
+
+If you're releasing a patch level version, you can use `rake
+release:open_unreleased_prs` to instead label each relevant PR with the proper
+milestone of the version to be release. Then the `rake release:patch` task will
+go _only_ through those PRs, and prompt you to add a changelog entry for each of
+them.
## Releases
@@ -79,8 +84,7 @@ Here's the checklist for releasing new minor versions:
* [ ] Create a new stable branch from master (see **Branching** below)
* [ ] Update `version.rb` to a prerelease number, e.g. `1.12.pre.1`
* [ ] Update `CHANGELOG.md` to include all of the features, bugfixes, etc for that
- version, from the [bundler-changelog](https://github.com/bundler/bundler-changelog)
- repo.
+ version.
* [ ] Run `rake release`, tweet, blog, let people know about the prerelease!
* [ ] Wait a **minimum of 7 days**
* [ ] If significant problems are found, increment the prerelease (i.e. 1.12.pre.2)
diff --git a/task/release.rake b/task/release.rake
index 8aeaa0bfee..73d3d5045c 100644
--- a/task/release.rake
+++ b/task/release.rake
@@ -75,7 +75,10 @@ namespace :release do
loop do
print(prompt)
print(": ") unless prompt.empty?
- break if $stdin.gets.strip == "y"
+
+ answer = $stdin.gets.strip
+ break if answer == "y"
+ abort if answer == "n"
end
rescue Interrupt
abort
@@ -215,14 +218,28 @@ namespace :release do
commits.reverse_each.map {|c| c =~ /(Auto merge of|Merge pull request|Merge) #(\d+)/ && $2 }.compact
end
- last_stable = `git ls-remote origin`.split("\n").map {|r| r =~ %r{refs/tags/v([\d.]+)$} && $1 }.compact.map {|v| Gem::Version.create(v) }.max
- last_stable = last_stable.segments[0, 2].<<("stable").join("-")
+ def minor_release_tags
+ `git ls-remote origin`.split("\n").map {|r| r =~ %r{refs/tags/v([\d.]+)$} && $1 }.compact.map {|v| Gem::Version.create(Gem::Version.create(v).segments[0, 2].join(".")) }.sort.uniq
+ end
+
+ def to_stable_branch(release_tag)
+ release_tag.segments[0, 2].<<("stable").join("-")
+ end
+
+ last_stable = to_stable_branch(minor_release_tags[-1])
+ previous_to_last_stable = to_stable_branch(minor_release_tags[-2])
+
+ in_release = prs("HEAD") - prs(last_stable) - prs(previous_to_last_stable)
- in_release = prs("HEAD") - prs(last_stable)
+ print "About to review #{in_release.size} pending PRs. "
+
+ confirm "Continue? (y/n)"
in_release.each do |pr|
- system("open", "https://github.com/bundler/bundler/pull/#{pr}")
- confirm
+ url_opener = /darwin/ =~ RUBY_PLATFORM ? "open" : "xdg-open"
+ url = "https://github.com/bundler/bundler/pull/#{pr}"
+ print "#{url}. (n)ext/(o)pen? "
+ system(url_opener, url, :out => IO::NULL, :err => IO::NULL) if $stdin.gets.strip == "o"
end
end
end