Francesco Servidio | 5bc9832 | 2021-11-03 13:19:22 +0100 | [diff] [blame] | 1 | # Release process |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 2 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 3 | This page describes the release process used with MCUboot. |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 4 | |
| 5 | ## Version numbering |
| 6 | |
| 7 | MCUboot uses [semantic versioning][semver], where version numbers |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 8 | follow a `MAJOR.MINOR.PATCH` format with the following guidelines on |
| 9 | incrementing the numbers: |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 10 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 11 | 1. MAJOR version when there are incompatible API changes. |
| 12 | 2. MINOR version when new functionalities were added in a |
| 13 | backward-compatible manner. |
| 14 | 3. PATCH version when there are backward-compatible bug fixes. |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 15 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 16 | We add pre-release tags using the format `MAJOR.MINOR.PATCH-rc1`. |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 17 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 18 | In the documentation, we mark an MCUBoot development version using the |
| 19 | format `MAJOR.MINOR.PATCH-dev`. |
Andrzej Puzdrowski | dfc7c5f | 2020-10-30 12:17:59 +0100 | [diff] [blame] | 20 | |
Francesco Servidio | 5bc9832 | 2021-11-03 13:19:22 +0100 | [diff] [blame] | 21 | ## Release notes |
David Brown | a303291 | 2017-09-12 12:07:45 -0600 | [diff] [blame] | 22 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 23 | Before making a release, update the `docs/release-notes.md` file |
| 24 | to describe the release. This should be a high-level description of |
David Brown | a303291 | 2017-09-12 12:07:45 -0600 | [diff] [blame] | 25 | the changes, not a list of the git commits. |
| 26 | |
Francesco Servidio | 5bc9832 | 2021-11-03 13:19:22 +0100 | [diff] [blame] | 27 | ## Release candidates |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 28 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 29 | Before each release, tags are made (see below) for at least one |
| 30 | release candidate (a.b.c-rc1, followed by a.b.c-rc2 and the subsequent |
| 31 | release candidates, followed by the official a.b.c release). The intent |
| 32 | is to freeze the code and allow testing. |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 33 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 34 | During the time between the rc1 and the final release, the only changes |
| 35 | that should be merged into the main branch are those to fix bugs found |
| 36 | in the RC and in the Mynewt metadata, as described in the next section. |
Fabio Utzig | e1727d9 | 2019-04-18 17:33:16 -0300 | [diff] [blame] | 37 | |
Francesco Servidio | 5bc9832 | 2021-11-03 13:19:22 +0100 | [diff] [blame] | 38 | ## Imgtool release |
Fabio Utzig | c7fe3b0 | 2019-10-10 07:35:40 -0300 | [diff] [blame] | 39 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 40 | imgtool is released through pypi.org (The Python package index). |
| 41 | It requires its version to be updated by editing |
Fabio Utzig | c7fe3b0 | 2019-10-10 07:35:40 -0300 | [diff] [blame] | 42 | `scripts/imgtool/__init__.py` and modifying the exported version: |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 43 | ``` |
| 44 | imgtool_version = "A.B.CrcN" |
| 45 | ``` |
Fabio Utzig | c7fe3b0 | 2019-10-10 07:35:40 -0300 | [diff] [blame] | 46 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 47 | This version should match the current release number of MCUboot. The |
| 48 | suffix `rcN` (with no dash) is accepted only for the pre-release versions |
| 49 | under test, while numbers are accepted only for the final releases. |
Fabio Utzig | c7fe3b0 | 2019-10-10 07:35:40 -0300 | [diff] [blame] | 50 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 51 | For more information, see [this |
| 52 | link](https://www.python.org/dev/peps/pep-0440/#pre-releases). |
Fabio Utzig | c7fe3b0 | 2019-10-10 07:35:40 -0300 | [diff] [blame] | 53 | |
Fabio Utzig | e1727d9 | 2019-04-18 17:33:16 -0300 | [diff] [blame] | 54 | ## Mynewt release information |
| 55 | |
Francesco Servidio | 4ff0c18 | 2021-10-20 15:27:16 +0200 | [diff] [blame] | 56 | On Mynewt, `newt` always fetches a versioned MCUboot release, so after |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 57 | the RC step is finished, the release needs to be exported by modifying |
Fabio Utzig | e1727d9 | 2019-04-18 17:33:16 -0300 | [diff] [blame] | 58 | `repository.yml` in the root directory; it must be updated with the |
| 59 | new release version, including updates to the pseudo keys |
Fabio Utzig | 20e747c | 2020-01-24 09:55:27 -0300 | [diff] [blame] | 60 | (`*-(latest|dev)`). |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 61 | |
Francesco Servidio | 5bc9832 | 2021-11-03 13:19:22 +0100 | [diff] [blame] | 62 | ## Tagging and release |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 63 | |
| 64 | To make a release, make sure your local repo is on the tip version by |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 65 | fetching from origin. Typically, the releaser should create a branch |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 66 | named after the particular release. |
| 67 | |
| 68 | Create a commit on top of the branch that modifies the version number |
| 69 | in the top-level `README.md`, and create a commit, with just this |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 70 | change, with a commit text similar to "Bump to version a.b.c". |
| 71 | Having the version bump helps to make the releases |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 72 | easier to find, as each release has a commit associated with it, and |
| 73 | not just a tag pointing to another commit. |
| 74 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 75 | Once this is done, the release should create a signed tag with the |
| 76 | appropriate tag name: |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 77 | ``` bash |
| 78 | git tag -s va.b.c-rcn |
| 79 | ``` |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 80 | The releaser will need to make sure that git is configured to use the |
| 81 | proper signing key, and that the public key is signed by enough parties to |
| 82 | be trusted. |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 83 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 84 | At this point, the tag can be pushed to GitHub to make the actual release |
| 85 | happen: |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 86 | ``` bash |
David Brown | fe0bfcf | 2021-05-14 10:12:10 -0600 | [diff] [blame] | 87 | git push origin HEAD:refs/heads/main |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 88 | git push origin va.b.c-rcn |
| 89 | ``` |
| 90 | |
Francesco Servidio | 5bc9832 | 2021-11-03 13:19:22 +0100 | [diff] [blame] | 91 | ## Branching after a release |
Fabio Utzig | 5b0f220 | 2021-01-13 11:16:40 -0300 | [diff] [blame] | 92 | |
| 93 | After the final (non-`rc`) a.b.0 release is made, a new branch must |
| 94 | be created and pushed: |
| 95 | |
| 96 | ``` bash |
| 97 | git checkout va.b.c |
| 98 | git checkout -b va.b-branch |
| 99 | git push origin va.b-branch |
| 100 | ``` |
| 101 | |
| 102 | This branch will be used to generate new incremental `PATCH` releases |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 103 | for bug fixes or required minor updates (for example, new `imgtool` features). |
Fabio Utzig | 5b0f220 | 2021-01-13 11:16:40 -0300 | [diff] [blame] | 104 | |
Andrzej Puzdrowski | dfc7c5f | 2020-10-30 12:17:59 +0100 | [diff] [blame] | 105 | ## Post release actions |
| 106 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame^] | 107 | Mark the MCUboot version as a development version. |
| 108 | |
| 109 | The version number used should be specified for the next expected release. |
Andrzej Puzdrowski | dfc7c5f | 2020-10-30 12:17:59 +0100 | [diff] [blame] | 110 | It should be larger than the last release version by incrementing the MAJOR or |
| 111 | the MINOR number. It is not necessary to define the next version precisely as |
| 112 | the next release version might still be different as it might be needed to do: |
| 113 | |
| 114 | - a patch release |
| 115 | - a MINOR release while a MAJOR release was expected |
| 116 | - a MAJOR release while a MINOR release was expected |
| 117 | |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 118 | [semver]: http://semver.org/ |