RELEASING_RAILS.md 7.3 KB
Newer Older
1
# Releasing Rails
2

3 4 5
In this document, we'll cover the steps necessary to release Rails. Each
section contains steps to take during that time before the release. The times
suggested in each header are just that: suggestions. However, they should
6 7
really be considered as minimums.

8
## 10 Days before release
9

10
Today is mostly coordination tasks. Here are the things you must do today:
11

12
### Is the CI green? If not, make it green. (See "Fixing the CI")
13

14
Do not release with a Red CI. You can find the CI status here:
15

16
```
17
https://travis-ci.org/rails/rails
18
```
19

20
### Is Sam Ruby happy? If not, make him happy.
21

22
Sam Ruby keeps a [test suite](https://github.com/rubys/awdwr) that makes
R
Rajat Bansal 已提交
23
sure the code samples in his book
24
([Agile Web Development with Rails](https://pragprog.com/book/rails51/agile-web-development-with-rails-51))
25 26
all work. These are valuable system tests
for Rails. You can check the status of these tests here:
27

28
[http://intertwingly.net/projects/dashboard.html](http://intertwingly.net/projects/dashboard.html)
29 30 31

Do not release with Red AWDwR tests.

32
### Do we have any Git dependencies? If so, contact those authors.
33

34 35
Having Git dependencies indicates that we depend on unreleased code.
Obviously Rails cannot be released when it depends on unreleased code.
36
Contact the authors of those particular gems and work out a release date that
37
suits them.
38

J
Jon Moss 已提交
39
### Contact the security team (either tenderlove or rafaelfranca)
40

41
Let them know of your plans to release. There may be security issues to be
42 43
addressed, and that can impact your release date.

44
### Notify implementors.
45

46
Ruby implementors have high stakes in making sure Rails works. Be kind and
47 48
give them a heads up that Rails will be released soonish.

49
This is only required for major and minor releases, bugfix releases aren't a
R
Rajat Bansal 已提交
50
big enough deal, and are supposed to be backward compatible.
51

52 53 54 55 56 57 58 59 60
Send an email just giving a heads up about the upcoming release to these
lists:

* team@jruby.org
* community@rubini.us
* rubyonrails-core@googlegroups.com

Implementors will love you and help you.

J
Jon Moss 已提交
61
## 3 Days before release
62

63
This is when you should release the release candidate. Here are your tasks
64 65
for today:

66
### Is the CI green? If not, make it green.
67

68
### Is Sam Ruby happy? If not, make him happy.
69

70
### Contact the security team. CVE emails must be sent on this day.
71

72
### Create a release branch.
73

74
From the stable branch, create a release branch. For example, if you're
75 76
releasing Rails 3.0.10, do this:

77 78 79 80 81
```
[aaron@higgins rails (3-0-stable)]$ git checkout -b 3-0-10
Switched to a new branch '3-0-10'
[aaron@higgins rails (3-0-10)]$
```
82

83
### Update each CHANGELOG.
84

85
Many times commits are made without the CHANGELOG being updated. You should
86 87 88 89 90
review the commits since the last release, and fill in any missing information
for each CHANGELOG.

You can review the commits for the 3.0.10 release like this:

91 92 93
```
[aaron@higgins rails (3-0-10)]$ git log v3.0.9..
```
94

J
Jon Leighton 已提交
95 96 97 98
If you're doing a stable branch release, you should also ensure that all of
the CHANGELOG entries in the stable branch are also synced to the master
branch.

99
### Put the new version in the RAILS_VERSION file.
100

101
Include an RC number if appropriate, e.g. `6.0.0.rc1`.
102

103
### Build and test the gem.
104

105 106 107
Run `rake verify` to generate the gems and install them locally. `verify` also
generates a Rails app with a migration and boots it to smoke test with in your
browser.
108

H
Hendy Tanata 已提交
109
This will stop you from looking silly when you push an RC to rubygems.org and
110
then realize it is broken.
111

112 113 114 115 116 117 118 119
### Release to RubyGems and npm.

IMPORTANT: Several gems have JavaScript components that are released as npm
packages, so you must have Node.js installed, have an npm account (npmjs.com),
and be a package owner for `@rails/actioncable`, `@rails/actiontext`,
`@rails/activestorage`, and `@rails/ujs`. You can check this by making sure your
npm user (`npm whoami`) is listed as an owner (`npm owner ls <pkg>`) of each
package. Do not release until you're set up with npm!
120

121
The release task will sign the release tag. If you haven't got commit signing
122
set up, use https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work as a
123 124 125 126 127
guide. You can generate keys with the GPG suite from here: https://gpgtools.org.

Run `rake changelog:header` to put a header with the new version in every
CHANGELOG. Don't commit this, the release task handles it.

128 129 130
Run `rake release`. This will populate the gemspecs and NPM package.json with
the current RAILS_VERSION, commit the changes, tag it, and push the gems to
rubygems.org.
131

132
### Send Rails release announcements
133 134

Write a release announcement that includes the version, changes, and links to
135
GitHub where people can find the specific commit list. Here are the mailing
136 137 138 139 140 141
lists where you should announce:

* rubyonrails-core@googlegroups.com
* rubyonrails-talk@googlegroups.com
* ruby-talk@ruby-lang.org

142
Use Markdown format for your announcement. Remember to ask people to report
143 144
issues with the release candidate to the rails-core mailing list.

R
Rafael França 已提交
145
NOTE: For patch releases, there's a `rake announce` task to generate the release
146 147 148 149 150 151
post. It supports multiple patch releases too:

```
VERSIONS="5.0.5.rc1,5.1.3.rc1" rake announce
```

152
IMPORTANT: If any users experience regressions when using the release
153
candidate, you *must* postpone the release. Bugfix releases *should not*
154 155
break existing applications.

156
### Post the announcement to the Rails blog.
157

R
Rajat Bansal 已提交
158
If you used Markdown format for your email, you can just paste it into the
159 160
blog.

Y
Yoshiyuki Hirano 已提交
161
* https://weblog.rubyonrails.org
162

163
### Post the announcement to the Rails Twitter account.
164

165
## Time between release candidate and actual release
166

167
Check the rails-core mailing list and the GitHub issue list for regressions in
168 169 170
the RC.

If any regressions are found, fix the regressions and repeat the release
171 172
candidate process. We will not release the final until 72 hours after the
last release candidate has been pushed. This means that if users find
173 174
regressions, the scheduled release date must be postponed.

175 176
When you fix the regressions, do not create a new branch. Fix them on the
stable branch, then cherry pick the commit to your release branch. No other
177 178
commits should be added to the release branch besides regression fixing commits.

179
## Day of release
180 181

Many of these steps are the same as for the release candidate, so if you need
B
Benjamin Winkler 已提交
182
more explanation on a particular step, see the RC steps.
183

184 185 186
Today, do this stuff in this order:

* Apply security patches to the release branch
K
Kirill Zhuravlov 已提交
187
* Update CHANGELOG with security fixes
188
* Update RAILS_VERSION to remove the rc
189
* Build and test the gem
190
* Release the gems
191 192 193
* If releasing a new stable version:
  - Trigger stable docs generation (see below)
  - Update the version in the home page
194 195
* Email security lists
* Email general announcement lists
196

197
### Emailing the Rails security announce list
198

199
Email the security announce list once for each vulnerability fixed.
200 201 202

You can do this, or ask the security team to do it.

203
Email the security reports to:
204

205
* rubyonrails-security@googlegroups.com
A
Aaron Patterson 已提交
206
* oss-security@lists.openwall.com
207 208

Be sure to note the security fixes in your announcement along with CVE numbers
209
and links to each patch. Some people may not be able to upgrade right away,
210 211 212 213
so we need to give them the security fixes in patch form.

* Blog announcements
* Twitter announcements
K
Kirill Zhuravlov 已提交
214
* Merge the release branch to the stable branch
215 216
* Drink beer (or other cocktail)

217
## Misc
218

219
### Fixing the CI
220 221 222 223 224 225

There are two simple steps for fixing the CI:

1. Identify the problem
2. Fix it

226
Repeat these steps until the CI is green.