|
| 1 | ++++ |
| 2 | +title = "Releasing" |
| 3 | ++++ |
| 4 | + |
| 5 | +This project uses [release-please] to automate changelog updates per release. Due to security restrictions[^1] in the |
| 6 | +`nutanix-cloud-native` GitHub organization, the release process is a little more complex than just using the |
| 7 | +[release-please-action]. |
| 8 | + |
| 9 | +When a release has been cut, a new release PR can be created manually using the `release-please` CLI locally. This needs |
| 10 | +to be run by someone with write permissions to the repository. Create the `release-please` branch and PR: |
| 11 | + |
| 12 | +```bash |
| 13 | +make release-please |
| 14 | +``` |
| 15 | + |
| 16 | +This will create the branch and release PR. From this point on until a release is ready, the `release-please-action` |
| 17 | +will keep the PR up to date (GHA workflows are only not allowed to create the original PR, they can keep the PR up to |
| 18 | +date). |
| 19 | + |
| 20 | +When a release is ready, the commits in the release PR will need to be signed (again, this is a security requirement). |
| 21 | +To do this, check out the PR branch locally: |
| 22 | + |
| 23 | +```bash |
| 24 | +gh pr checkout <RELEASE_PR_NUMBER> |
| 25 | +``` |
| 26 | + |
| 27 | +Sign the previous commit: |
| 28 | + |
| 29 | +```bash |
| 30 | +git commit --gpg-sign --amend |
| 31 | +``` |
| 32 | + |
| 33 | +And force push: |
| 34 | + |
| 35 | +```bash |
| 36 | +git push --force-with-lease |
| 37 | +``` |
| 38 | + |
| 39 | +The PR will then need the standard 2 reviewers and will then be auto-merged, triggering the release jobs to run and push |
| 40 | +relevant artifacts and images. |
| 41 | + |
| 42 | +[^1]: Specifically, GitHub Actions workflows are not allowed to create or approve PRs due to a potential security flaw. |
| 43 | + See [this blog post][cider-sec] for more details, as well as the [Security Hardening for GitHub Actions |
| 44 | + docs][gha-security-hardening]. |
| 45 | + |
| 46 | +[release-please]: https://github.com/googleapis/release-please/ |
| 47 | +[release-please-action]: https://github.com/google-github-actions/release-please-action |
| 48 | +[cider-sec]: https://medium.com/cider-sec/bypassing-required-reviews-using-github-actions-6e1b29135cc7 |
| 49 | +[gha-security-hardening]: https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions |
0 commit comments