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