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 | |
Jamie McCrae | a6aef32 | 2023-05-25 08:19:26 +0100 | [diff] [blame] | 68 | ## Zephyr release information |
| 69 | |
| 70 | There is a version file used by Zephyr builds to indicate the version |
| 71 | of MCUboot being used which needs to be updated at |
| 72 | `boot/zephyr/VERSION`. For alignment with Zephyr versions, development |
| 73 | versions should set `PATCHLEVEL` to `99` and `EXTRAVERSION` to `dev`, |
| 74 | whilst production versions should correctly set `PATCHLEVEL` and clear |
| 75 | `EXTRAVERSION`. |
| 76 | |
Francesco Servidio | 5bc9832 | 2021-11-03 13:19:22 +0100 | [diff] [blame] | 77 | ## Tagging and release |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 78 | |
| 79 | 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] | 80 | fetching from origin. Typically, the releaser should create a branch |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 81 | named after the particular release. |
| 82 | |
| 83 | Create a commit on top of the branch that modifies the version number |
| 84 | 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] | 85 | change, with a commit text similar to "Bump to version a.b.c". |
| 86 | Having the version bump helps to make the releases |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 87 | easier to find, as each release has a commit associated with it, and |
| 88 | not just a tag pointing to another commit. |
| 89 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame] | 90 | Once this is done, the release should create a signed tag with the |
| 91 | appropriate tag name: |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 92 | ``` bash |
| 93 | git tag -s va.b.c-rcn |
| 94 | ``` |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame] | 95 | The releaser will need to make sure that git is configured to use the |
| 96 | proper signing key, and that the public key is signed by enough parties to |
| 97 | be trusted. |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 98 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame] | 99 | At this point, the tag can be pushed to GitHub to make the actual release |
| 100 | happen: |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 101 | ``` bash |
David Brown | fe0bfcf | 2021-05-14 10:12:10 -0600 | [diff] [blame] | 102 | git push origin HEAD:refs/heads/main |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 103 | git push origin va.b.c-rcn |
| 104 | ``` |
| 105 | |
Francesco Servidio | 5bc9832 | 2021-11-03 13:19:22 +0100 | [diff] [blame] | 106 | ## Branching after a release |
Fabio Utzig | 5b0f220 | 2021-01-13 11:16:40 -0300 | [diff] [blame] | 107 | |
| 108 | After the final (non-`rc`) a.b.0 release is made, a new branch must |
| 109 | be created and pushed: |
| 110 | |
| 111 | ``` bash |
| 112 | git checkout va.b.c |
| 113 | git checkout -b va.b-branch |
| 114 | git push origin va.b-branch |
| 115 | ``` |
| 116 | |
| 117 | This branch will be used to generate new incremental `PATCH` releases |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame] | 118 | for bug fixes or required minor updates (for example, new `imgtool` features). |
Fabio Utzig | 5b0f220 | 2021-01-13 11:16:40 -0300 | [diff] [blame] | 119 | |
Andrzej Puzdrowski | dfc7c5f | 2020-10-30 12:17:59 +0100 | [diff] [blame] | 120 | ## Post release actions |
| 121 | |
Francesco Domenico Servidio | 4fb288a | 2022-01-11 16:32:25 +0100 | [diff] [blame] | 122 | Mark the MCUboot version as a development version. |
| 123 | |
| 124 | The version number used should be specified for the next expected release. |
Andrzej Puzdrowski | dfc7c5f | 2020-10-30 12:17:59 +0100 | [diff] [blame] | 125 | It should be larger than the last release version by incrementing the MAJOR or |
| 126 | the MINOR number. It is not necessary to define the next version precisely as |
| 127 | the next release version might still be different as it might be needed to do: |
| 128 | |
| 129 | - a patch release |
| 130 | - a MINOR release while a MAJOR release was expected |
| 131 | - a MAJOR release while a MINOR release was expected |
| 132 | |
David Brown | c337025 | 2017-09-12 10:36:19 -0600 | [diff] [blame] | 133 | [semver]: http://semver.org/ |