HOWTO-make-a-release.md: take into account the moved newsflash.txt
[tools.git] / HOWTO-make-a-release.md
1 # HOW TO MAKE A RELEASE
2
3 This file documents how to make an OpenSSL release.  Please fix any errors
4 you find while doing, or just after, your next release!
5
6 Releases are done by one person, with a second person acting as the reviewer
7 and additional tester.
8
9 # Table of contents
10
11 -   [Prerequisites](#prerequisites)
12     -   [Software](#software)
13     -   [Repositories](#repositories)
14     -   [PGP / GnuPG key](#pgp-gnupg-key)
15     -   [SSH access](#check-your-access)
16     -   [A method for reviewing](#a-way-to-reviewing)
17 -   [Pre-publishing tasks](#pre-publishing-tasks)
18     -   [Prepare your repository checkouts](#prepare-your-repository-checkouts)
19     -   [Freeze the source repository](#freeze-the-source-repository) [the day before release]
20     -   [Make sure that the openssl source is up to date](#make-sure-that-the-openssl-source-is-up-to-date)
21     -   [Generate the tarball and announcement text](#generating-the-tarball-and-announcement-text)
22         -   [OpenSSL 3.0 and on](#openssl-3.0-and-on)
23         -   [OpenSSL before 3.0](#openssl-before-3.0)
24     -   [Update the release data locally](#update-the-release-data-locally)
25         [do not push]
26     -   [Update the website locally](#update-the-website-locally)
27         [security advisory only, do not push]
28 -   [Publish the release](#publish-the-release)
29     -   [Updating the release data](#updating-the-release-data)
30     -   [Updating the website](#updating-the-website) [security advisory only]
31 -   [Post-publishing tasks](#post-publishing-tasks)
32     -   [Check the website](#check-the-website)
33     -   [Send the announcement mail](#send-the-announcement-mail)
34     -   [Send out the Security Advisory](#send-out-the-security-advisory)
35     -   [Unfreeze the source repository](#unfreeze-the-source-repository)
36     -   [Security fixes](#security-fixes)
37     -   [Keep in touch](#keep-in-touch)
38
39
40 # Prerequisites
41
42 ## Software
43
44 Apart from the basic operating system utilities, you must have the following
45 programs in you `$PATH`:
46
47 - openssl
48 - ssh
49 - gpg
50 - git
51
52 (note: this may not be a complete list)
53
54 ## Repositories
55
56 You must have access to the following repositories:
57
58 -   `git@github.openssl.org:openssl/openssl.git`
59
60     This is the usual main source repository
61
62 -   `git@github.openssl.org:openssl/web.git`
63
64     This is the website repository
65
66 -   `git@github.openssl.org:otc/tools.git`
67
68     This contains certain common tools
69
70 -   `git@github.openssl.org:omc/data.git`
71
72     This contains files to be updated as part of any release
73
74 ## PGP / GnuPG key
75
76 You must have a PGP / GnuPG key, and its fingerprint should be present in
77 the file `doc/fingerprints.txt` in the source of the immediately prior
78 OpenSSL release.
79
80 ## SSH access
81
82 To perform a release, you must have appropriate access to OpenSSL's
83 development host, dev.openssl.org.  To test this, try to log in with ssh:
84
85     ssh dev.openssl.org
86
87 You must also check that you can perform tasks as the user 'openssl' on
88 dev.openssl.org.  When you have successfully logged in, test your access to
89 that user with sudo:
90
91     sudo -u openssl id
92
93 ## A method for reviewing
94
95 For reviewing to take place, the release person and the reviewer need a way
96 to share changes that are being applied.  Most commonly, that's done as PRs
97 (for normal releases) or security advisories (for undisclosed security
98 fixes) through Github.
99
100 Security advisories are created using the Github Security tab, and will
101 generate a private repository, to which you can add collaborators (the
102 reviewer, for instance), and use it to fix the issue via pull requests.
103 For more information, please read Github's [creating a security advisory],
104 including the "Next Steps" at the end of that page.
105
106 [creating a security advisory]:
107 <https://docs.github.com/en/free-pro-team@latest/github/managing-security-vulnerabilities/creating-a-security-advisory>
108
109 The release person and the reviewer are allowed to use other means to share
110 the commits to be reviewed if they desire.
111
112 The release person and the reviewer must have a conversation to confirm or
113 figure out how the review shall be done.
114
115 # Pre-publishing tasks
116
117 Some of the actions in this section need to be repeated for each OpenSSL
118 version released.
119
120 ## Prepare your repository checkouts
121
122 You will need to checkout at least three working trees:
123
124 -   one for the website
125
126         git clone git@github.openssl.org:openssl/web.git website
127
128 -   one for extra tools
129
130         git clone git@github.openssl.org:otc/tools.git tools
131
132     The resulting directory will be referred to as `$TOOLS`
133
134 -   one for release data
135
136         git clone git@github.openssl.org:omc/data.git data
137
138 -   At least one for openssl source
139
140         git clone git@github.openssl.org:openssl/openssl.git
141
142     If you're doing multiple releases in one go, there are many ways to deal
143     with it.  One possibility, available since git 2.5, is to use `git
144     worktree`:
145
146         (cd openssl;
147          git worktree add ../openssl-1.1.1 OpenSSL_1_1_1-stable)
148
149 ## Freeze the source repository
150
151 Three business day before the release, freeze the main repository.  This
152 locks out everyone but the named user, who is doing the release, from doing
153 any pushes.  Someone other than the person doing the release should run the
154 command.
155
156 This must be done from a checkout of `git@github.openssl.org:openssl/openssl.git`.
157
158     git push git@github.openssl.org:openssl/openssl.git refs/frozen/NAME
159
160 Where `NAME` is the github username of the user doing the release.
161
162 ## Make sure that the openssl source is up to date
163
164 The person doing the release and the reviewer should both sanity-check the
165 source to be released at this point.  Checks to consider include building
166 and verifying that make test passes on multiple plaforms - Linux, Windows,
167 etc.
168
169 *NOTE: the files CHANGES and NEWS are called CHANGES.md and NEWS.md in
170 OpenSSL versions from version 3.0 and on*
171
172 For each source checkout, make sure that the CHANGES and NEWS files have
173 been updated and reviewed.
174
175 The NEWS file should contain a summary of any changes for the release;
176 for a security release, it's often simply a list of the CVEs addressed.
177 You should also update NEWS.md in the master branch to include details of
178 all releases.  Only update the bullet points - do not change the release
179 date, keep it as **under development**.
180
181 Add any security fixes to the tree and commit them.
182
183 Make sure that the copyrights are updated.  This script will update the
184 copyright markers and commit the changes (where $TOOLS stands for the
185 openssl-tools.git checkout directory):
186
187     $TOOLS/release-tools/do-copyright-year
188
189 Obtain approval for these commits from the reviewer and add the Release and
190 Reviewed-By trailers as required.
191
192 *Do* send the auto-generated commits to the reviewer and await their
193 approval.
194
195 *Do not push* changes to the main source repo at this stage.
196 (the main source repo being `git@github.openssl.org:openssl/openssl.git`)
197
198 ## Generate the tarball and announcement text
199
200 *The changes in this section should be made in your clone of the openssl
201 source repo*
202
203 The method to generate a release tarball and announcement text has changed
204 with OpenSSL 3.0, so while we continue to make pre-3.0 OpenSSL releases,
205 there are two methods to be aware of.
206
207 Both methods will leave a handful of files, most importantly the release
208 tarball.  When they are done, they display a set of instructions on how to
209 perform the publishing tasks, *please take note of them*.
210
211 After having run the release script, verify that its results are sensible.
212 Check the commits that were added, using for example `git log`.  Check the
213 signed announcement .asc file.  Check that the tarball length and hashes
214 match in the .md5, .sha1, .sha256, and review the announcment file.
215
216 *Do* send the auto-generated commits to the reviewer and await their
217 approval.
218
219 *Do not push* changes to the main source repo at this stage.
220 (the main source repo being `git@github.openssl.org:openssl/openssl.git`)
221
222 ### OpenSSL 3.0 and on
223
224 The release generating script is in the OpenSSL source checkout, and is
225 generally called like this:
226
227     dev/release.sh --reviewer=NAME
228
229 This script has a multitude of other options that are useful for specific
230 cases, and is also self-documented:
231
232 -   To get a quick usage reminder:
233
234         dev/release.sh --help
235
236 -   To get a man-page:
237
238         dev/release.sh --manual
239
240 ### OpenSSL before 3.0
241
242 The release generating script is in the tools checkout, represented here
243 with $TOOLS, and is generally called like this:
244
245     $TOOLS/release-tools/mkrelease.pl --reviewer=NAME
246
247 The manual for that script is found in `$TOOLS/release-tools/MKRELEASE.md`
248
249 ## Update the release data locally
250
251 *The changes in this section should be made in your clone of the release
252 data repo*
253
254 Update the newsflash.txt file.  This normally is one or two lines.  Just
255 copy and paste existing announcements making minor changes for the date and
256 version number as necessary.  If there is an advisory then ensure you
257 include a link to it.
258
259 *Do* send the commits to the reviewer and await their approval.
260
261 Commit your changes, but *do not push* them to the release data repo at this
262 stage.  (the release data repo being `git@github.openssl.org:omc/data.git`)
263
264 ## Update the website locally
265
266 **This is for security advisory updates only**
267
268 *The changes in this section should be made in your clone of the openssl
269 web repo*
270
271 Update the news/vulnerabilities.xml file if appropriate.
272
273 If there is a Security Advisory then copy it into the news/secadv directory.
274
275 *Do* send the commits to the reviewer and await their approval.
276
277 Commit your changes, but *do not push* them to the website repo at this stage.
278 (the website repo being `git@github.openssl.org:openssl/web.git`)
279
280 # Publish the release
281
282 *BE CAREFUL*  This section makes everything visible and is therefore largely
283 irreversible.  If you are performing a dry run then DO NOT perform any steps
284 in this section.
285
286 Check that the release has been uploaded properly.  The release tarballs and
287 associated files should be in ~openssl/dist/new.  They should be owned by
288 the openssl userid and world-readable.
289
290 Copy the tarballs to appropriate directories.  This can be done using the
291 do-release.pl script.  See $TOOLS/release-tools/DO-RELEASE.md for a
292 description of the options.  For example:
293
294     sudo -u openssl perl ~openssl/do-release.pl --copy --move
295
296 This will copy the relevant files to the website and move them from
297 `~openssl/dist/new` to `~openssl/dist/old` so they will not seen by a
298 subsequent release.  Alternatively if you want to perform one release at a
299 time or copy/move the files manually, see below.
300
301 The do-release.pl script will display the commands you will need to issue to
302 send the announcement emails later.  Keep a note of those commands for
303 future reference.
304
305 Verify that the tarballs are available via FTP:
306
307     ftp://ftp.openssl.org/source/
308
309 And that they are ready for the website:
310
311     ls /var/www/openssl/source
312
313 *For OpenSSL 3.0 and on*, push your local changes to the main source repo as
314 instructed by `dev/release.sh`.  You may want to sanity check the pushes by
315 inserting the `-n` (dry-run) option.
316
317 *For OpenSSL before 3.0*, simply push your local changes to the main source
318 repo, and please do remember to push the release tags as well. You may want to
319 sanity check the pushes by inserting the `-n` (dry-run) option. You must specify
320 the repository / remote and tag to be pushed:
321
322     git push <repository> <tagname>
323
324 ## Updating the release data
325
326 Push the newsflash changes to the release data repo.  When you do this, the
327 website will get updated and a script to flush the Akamai CDN cache will be
328 run.  You can look at things on www-origin.openssl.org; the CDN-hosted
329 www.openssl.org should only be a few minutes delayed.
330
331 ## Updating the website
332
333 **This is for security advisory updates only**
334
335 Push the website changes you made earlier to the OpenSSL website repo.  When
336 you do this, the website will get updated and a script to flush the Akamai
337 CDN cache will be run.  You can look at things on www-origin.openssl.org;
338 the CDN-hosted www.openssl.org should only be a few minutes delayed.
339
340 # Post-publishing tasks
341
342 ## Check the website
343
344 Verify that the release notes, which are built from the CHANGES.md file
345 in the release, have been updated.  This is done automatically by the
346 commit-hook, but if you see a problem, try the following steps on
347 `dev.openssl.org`:
348
349     cd /var/www/openssl
350     sudo -u openssl -H make relupd
351     sudo -u openssl -H ./bin/purge-one-hour
352
353 Wait for a while for the Akamai flush to work (normally within a few minutes).
354 Have a look at the website and news announcement at:
355
356 -   <https://www.openssl.org/>
357 -   <https://www.openssl.org/news/>
358
359 Check the download page has updated properly:
360
361 -   <https://www.openssl.org/source/>
362
363 Check the notes look sensible at:
364
365 -   <https://www.openssl.org/news/newslog.html>
366
367 Also check the notes here:
368
369 -   <https://www.openssl.org/news/openssl-1.0.2-notes.html>
370 -   <https://www.openssl.org/news/openssl-1.1.0-notes.html>
371 -   <https://www.openssl.org/news/openssl-1.1.1-notes.html>
372
373 ## Send the announcement mail
374
375 Send out the announcements.  Generic release announcement messages will be
376 created automatically by the build script and the commands you need to use
377 to send them were displayed when you executed do-release.pl above.
378 These are sent to openssl-users, openssl-project, and openssl-announce. They
379 should be sent from the account of the person that owns the key used for signing
380 the release announcement. Ensure that mutt is configured correctly - send a test
381 email first if necessary.
382
383 If do-release.pl was used with `--move` be sure to move the announcement
384 text files away from the staging directory after they have been sent.  This
385 is done as follows (with VERSION replaced with the version of OpenSSL to
386 announce):
387
388     REPLYTO="openssl@openssl.org" mutt -s "OpenSSL version VERSION published" \
389             openssl-project openssl-users openssl-announce \
390             < /home/openssl/dist/new/openssl-VERSION.txt.asc
391     sudo -u openssl \
392         mv ~openssl/dist/new/openssl-VERSION.txt.asc ~openssl/dist/old
393
394 ## Send out the Security Advisory
395
396 *The secadv file mentioned in this section is the Security Advisory
397 that you copied into the web repo, up in the section
398 [Update the website locally](#update-the-website-locally)*
399  
400 *This section is only applicable if this is a security release*
401
402 Start with signing the Security Advisory as yourself:
403
404     gpg --clearsign secadv_FILENAME.txt
405
406 Then copy the result to the temporary directory on dev.openssl.org:
407
408     scp secadv_FILENAME.txt.asc dev.openssl.org:/tmp
409
410 To finish, log in on dev.openssl.org and send the signed Security
411 Advisory by email as the user that signed the advisory, and then remove it:
412
413     REPLYTO="openssl@openssl.org" mutt -s "OpenSSL Security Advisory" \
414             openssl-project openssl-users openssl-announce \
415             </tmp/secadv_FILENAME.txt.asc
416     rm /tmp/secadv_FILENAME.txt.asc
417
418 Approve the openssl-announce email.  Go to
419 <https://mta.openssl.org/mailman/admindb/openssl-announce>
420 and approve the messages.
421
422 Check the mailing list messages have arrived.
423
424 ## Unfreeze the source repository.
425
426 This must be done from a checkout of the main source repo.
427
428     git push --delete git@github.openssl.org:openssl/openssl.git \
429         refs/frozen/NAME
430
431 ## Security fixes
432
433 If this release includes security fixes with a CVE then you should inform
434 MITRE about them.  See the instructions at the top of cvepool.txt in omc.
435
436 Close the github advisory without pushing to github and remove the private
437 github fork if there was one.
438
439 ## Keep in touch
440
441 Check mailing lists over the next few hours for reports of any success or
442 failure.  If necessary fix these and in the worst case make another
443 release.
444