|
| 1 | +# Release Process |
| 2 | + |
| 3 | +This describes the steps for making a release. |
| 4 | + |
| 5 | +## Create a Release PR |
| 6 | + |
| 7 | +* Create a branch that will contain changes for the release |
| 8 | +* Update the [CHANGELOG.md](../CHANGELOG.md) using the most recent version as a guide |
| 9 | + * Go through the PRs since the last release and add each PR and descriptive text to the `Breaking changes`, `Features`, `Bug fixes` or `Build changes` sections |
| 10 | +* Update the versions in the 3 main CMakeLists.txt in the `project` blocks, where `VERSION` has the form `<major version>.<minor version>` |
| 11 | + * [bmx CMakeLists.txt](../CMakeLists.txt), [libMXF CmakeLists.txt](../deps/libMXF/CMakeLists.txt) and [libMXFpp CmakeLists.txt](../deps/libMXFpp/CMakeLists.txt) |
| 12 | +* Check that the build & tests succeed and fix any build warnings |
| 13 | +* Check the [runner versions](https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners) (e.g. `windows-2019` and `macos-13`) in the [release workflow](../.github/workflows/release.yml) are still available and update the workflow if not |
| 14 | +* Run the `Release` workflow in GitHub Actions using this PR's branch to check it succeeds |
| 15 | +* Merge the PR into `main` |
| 16 | + |
| 17 | +## Create a Release Tag |
| 18 | + |
| 19 | +* Checkout and fetch the `main` branch |
| 20 | +* Create a tag with form `v<major version>.<minor version>`, e.g. export `BMX_VERSION` (without the `v`), replacing `<major version>.<minor version>` below |
| 21 | + |
| 22 | +```bash |
| 23 | +export BMX_VERSION=<major version>.<minor version> |
| 24 | +git checkout main |
| 25 | +git pull --rebase |
| 26 | +git tag -a v${BMX_VERSION} -m "Version ${BMX_VERSION}"` |
| 27 | +git push origin v${BMX_VERSION} |
| 28 | +``` |
| 29 | + |
| 30 | +## Create the Release Packages |
| 31 | + |
| 32 | +* Run the `Release` workflow in GitHub Actions |
| 33 | +* Download the Artifacts and extract the individual source and binary zips for the release |
| 34 | + |
| 35 | +## Create a GitHub Release |
| 36 | + |
| 37 | +* Create a new release |
| 38 | +* Write the release text using the previous release's text as a starting point |
| 39 | + * Select the `v<major version>.<minor version>` tag |
| 40 | + * Change the CHANGELOG link |
| 41 | + * Update the zip filenames with the new version |
| 42 | + * Update the compiler versions used for the binaries |
| 43 | + * These can be found in the actions output in the `Win64 binary release` and `MacOS Universal binary release` build steps in the 2 jobs of the `Release` workflow in GitHub Actions |
| 44 | +* Upload the source and binary zips to the release |
| 45 | +
|
| 46 | +## Create a Docker Image for the GitHub Container Registry |
| 47 | +
|
| 48 | +* Aquire a Linux machine with Docker installed |
| 49 | +* Build the `bmxtools` image and tag using the commands below |
| 50 | + * `BMX_VERSION` should be set as before; note also the `.0` for the patch version. |
| 51 | +
|
| 52 | +```bash |
| 53 | +DOCKER_BUILDKIT=1 docker build -t bmxtools . |
| 54 | +docker tag bmxtools ghcr.io/bbc/bmxtools:${BMX_VERSION}.0 |
| 55 | +docker tag bmxtools ghcr.io/bbc/bmxtools:latest |
| 56 | +``` |
| 57 | +
|
| 58 | +* On your GitHub personal page, go to "Settings" (top right) -> "Developer settings" (bottom) -> "Personal Access Tokens" / "Tokens (classic)" |
| 59 | + * Select "Generate New Token" and "Generate new token (classic)" |
| 60 | + * Change "Expiration" to 7 days |
| 61 | + * Select "write:packages" (which will select "read:packages" and all of "repo") |
| 62 | + * Select "Generate Token" |
| 63 | + * Copy the token into your clipboard |
| 64 | +* Login into GHCR and push the image using the commands below |
| 65 | + * Replace `<username>` with your GitHub username |
| 66 | + * Pass in the token when docker login requests it |
| 67 | + * `BMX_VERSION` should be set as before; note also the `.0` for the patch version |
| 68 | +
|
| 69 | +```bash |
| 70 | +docker login ghcr.io --username <username> |
| 71 | +docker push ghcr.io/bbc/bmxtools:${BMX_VERSION}.0 |
| 72 | +docker push ghcr.io/bbc/bmxtools:latest |
| 73 | +docker logout ghcr.io |
| 74 | +``` |
0 commit comments