|
| 1 | +# Release procedure |
| 2 | + |
| 3 | +This section describes how to release a new set of supported versions of |
| 4 | +CloudNativePG, and should be done by one of the maintainers of the project. It |
| 5 | +is a semi-automated process which requires human supervision. |
| 6 | + |
| 7 | +You can only release from a release branch, that is a branch in the |
| 8 | +Git repository called `release-X.Y`, i.e. `release-1.16`, which corresponds |
| 9 | +to a minor release. |
| 10 | + |
| 11 | +The release procedure must be repeated for all the supported minor releases, |
| 12 | +usually 3: |
| 13 | + |
| 14 | +- the current one (`release-X.Y`) |
| 15 | +- the previous one (`release-X.Y` -1) |
| 16 | +- the *"End of Life"* one (`release-X.Y` -2) - normally for an additional month |
| 17 | + after the first release of the current minor. |
| 18 | + |
| 19 | +```diagram |
| 20 | +------+---------------------------------------------> main (trunk development) |
| 21 | + \ \ |
| 22 | + \ \ |
| 23 | + \ \ LATEST RELEASE |
| 24 | + \ \ ^ |
| 25 | + \ \----------+---------------> release-X.Y | |
| 26 | + \ | SUPPORTED |
| 27 | + \ | RELEASES |
| 28 | + \ | = the two |
| 29 | + \ | last |
| 30 | + +-------------------+---------------> release-X.Y-1 | releases |
| 31 | + v |
| 32 | +``` |
| 33 | + |
| 34 | +## Release branches |
| 35 | + |
| 36 | +A release branch must always originate from the *trunk* (`main` branch), |
| 37 | +and corresponds to a new minor release. |
| 38 | + |
| 39 | +Development happens on the trunk (`main` branch), and bug fixes are |
| 40 | +cherry-picked in the actively supported release branches by the maintainers. |
| 41 | +Sometimes, bug fixes might originate in the release branch as well. |
| 42 | +Release notes for patch/security versions are maintained in the release branch |
| 43 | +directly. |
| 44 | + |
| 45 | +## Planning the release |
| 46 | + |
| 47 | +One or two weeks before the release, you should start planning the following |
| 48 | +activities: |
| 49 | + |
| 50 | +- **Supported releases:** Make sure that you update the supported releases' page |
| 51 | + in `docs/src/supported_releases.md` and have been approved by the maintainers |
| 52 | + |
| 53 | +- **Release notes:** Make sure release notes for the release have been updated |
| 54 | + in `docs/src/release_notes.md` and have been approved by the maintainers |
| 55 | + |
| 56 | +- **Capabilities page:** in case of a new minor release, make sure that the |
| 57 | + operator capability levels page has been updated in |
| 58 | + `docs/src/operator_capability_levels.md` and approved by the maintainers |
| 59 | + |
| 60 | +- **Documentation:** Make sure that you update the documentation in the |
| 61 | + [website project](https://github.com/cloudnative-pg/cloudnative-pg.github.io) |
| 62 | + for each of the supported releases via a PR. |
| 63 | + |
| 64 | +<!-- TODO: we should create an issue template with a checklist for the release process --> |
| 65 | + |
| 66 | +## Release steps |
| 67 | + |
| 68 | +Once the code in the release branch is stable and ready to be released, you can |
| 69 | +proceed with the supervised process. |
| 70 | + |
| 71 | +As a maintainer, you need to repeat this process for each of the supported |
| 72 | +releases of CloudNativePG: |
| 73 | + |
| 74 | +1. Run `hack/release.sh X.Y.Z` (e.g. `hack/release.sh 1.16.0`) |
| 75 | +2. Quickly review the PR that is automatically generated by the script and |
| 76 | + approve it |
| 77 | +3. Merge the PR, making sure that the commit message title is: |
| 78 | + `Version tag to X.Y.Z`, without prefixes (e.g.: `Version tag to 1.16.0`) |
| 79 | +4. Wait until all [GitHub Actions](https://github.com/cloudnative-pg/cloudnative-pg/actions) |
| 80 | + complete successfully. |
| 81 | +5. Perform manual smoke tests to verify that installation instructions work on |
| 82 | + your workstation using `kind` |
| 83 | + |
| 84 | +## Helm chart release: |
| 85 | + |
| 86 | +After having created a new release of CloudNativePG you need to create a release of |
| 87 | +the `cloudnative-pg` and `cnpg-sandbox` charts, whose definitions can be found |
| 88 | +in the [cloudnative-pg/charts](https://github.com/cloudnative-pg/charts) repository. |
| 89 | + |
| 90 | +The following is a summary of the steps to be taken in that direction. The |
| 91 | +[RELEASE.md](https://github.com/cloudnative-pg/charts/blob/a47596cb/RELEASE.md) |
| 92 | +document inside the relative repo contains an in-depth discussion of the |
| 93 | +process. |
| 94 | + |
| 95 | +1. Copy the output of `kustomize build config/helm` to `charts/cloudnative-pg/templates/crds/crds.yaml` |
| 96 | + in the [cloudnative-pg/charts](https://github.com/cloudnative-pg/charts) repository. |
| 97 | +2. Diff the new release version with the previous one |
| 98 | + (e.g.: `vimdiff releases/cnpg-1.15.0.yaml releases/cnpg-1.15.1.yaml` using your IDE of choice) |
| 99 | +3. Port any diff to the templates in the helm chart accordingly |
| 100 | +4. Proceed with the release process described in the `RELEASE.md` |
| 101 | + file in the [cloudnative-pg/charts](https://github.com/cloudnative-pg/charts) repository. |
0 commit comments