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