Skip to content
34 changes: 34 additions & 0 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and Publish Image

on:
workflow_dispatch: # allows manual runs from the Actions tab

env:
REGISTRY: ghcr.io
TOOL_NAME: 'bmxtools'
VERSION: '1.7.0'

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v6.0.2

- name: Log in to GHCR
uses: docker/login-action@v4.2.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v7.2.0
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.TOOL_NAME }}:latest, ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.TOOL_NAME }}:${{ env.VERSION }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ compile_commands.json
CTestTestfile.cmake
_deps
out/
.DS_Store
37 changes: 6 additions & 31 deletions docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ This describes the steps for making a release.
* 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
* Update the versions in the 3 main CMakeLists.txt files in the `project` blocks, where `VERSION` has the form `<major version>.<minor version>`
* The files are [bmx CMakeLists.txt](../CMakeLists.txt), [libMXF CmakeLists.txt](../deps/libMXF/CMakeLists.txt) and [libMXFpp CmakeLists.txt](../deps/libMXFpp/CMakeLists.txt)
* Run the [Build & Test](https://github.com/ebu/bmx/actions/workflows/build_and_test.yml) workflow in GitHub Actions using the release branch and fix any build errors and warnings
* Update the version in the [Build and Publish Image](../.github/workflows/publish-image.yml) file, where `VERSION` has the form `<major version>.<minor version>.<patch version>`
* Run the [Build & Test](../.github/workflows/build_and_test.yml) workflow in GitHub Actions using the release branch and fix any build errors and warnings
* 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.yml](../.github/workflows/release.yml) workflow file are still available
* Select the oldest macOS version available to help with compatibility
* Run the [Release](https://github.com/ebu/bmx/actions/workflows/release.yml) workflow in GitHub Actions using the release branch to check it succeeds
* Run the [Release](../.github/workflows/release.yml) workflow in GitHub Actions using the release branch to check it succeeds
* On the release branch, create a temporary tag and then delete the tag once the workflow succeeds:

```bash
Expand Down Expand Up @@ -43,7 +44,7 @@ git push origin v${BMX_VERSION}

## Create the Release Packages

* Run the [Release](https://github.com/ebu/bmx/actions/workflows/release.yml) workflow in GitHub Actions
* Run the [Release](../.github/workflows/release.yml) workflow in GitHub Actions
* Download the Artifacts and extract the individual source and binary zips for the release

## Create a GitHub Release
Expand All @@ -54,35 +55,9 @@ git push origin v${BMX_VERSION}
* Change the CHANGELOG link
* Update the zip filenames with the new version
* Update the compiler versions used for the binaries
* 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](https://github.com/ebu/bmx/actions/workflows/release.yml) workflow in GitHub Actions
* 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](../.github/workflows/release.yml) workflow in GitHub Actions
* Upload the source and binary zips to the release

## Create a Docker Image for the GitHub Container Registry

* Acquire a Linux machine with Docker installed
* Build the `bmxtools` image and tag using the commands below
* `BMX_VERSION` should be set as before; note also the additional `.0` for the patch version.

```bash
DOCKER_BUILDKIT=1 docker build --platform linux/amd64 -t bmxtools .
docker tag bmxtools ghcr.io/ebu/bmxtools:${BMX_VERSION}.0
docker tag bmxtools ghcr.io/ebu/bmxtools:latest
```

* In your [GitHub settings](https://github.com/settings/tokens) to create tokens
* Select "Generate New Token" and "Generate new token (classic)"
* Change "Expiration" to 7 days
* Select "write:packages" (which will select "read:packages" and all of "repo")
* Select "Generate Token"
* Copy the token which you'll need to pass in when logging into the GitHub Docker registry
* Login into GHCR and push the image using the commands below
* Replace `<username>` with your GitHub username
* Pass in the token when docker login requests it
* `BMX_VERSION` should be set as before; note also the additional `.0` for the patch version

```bash
docker login ghcr.io --username <username>
docker push ghcr.io/ebu/bmxtools:${BMX_VERSION}.0
docker push ghcr.io/ebu/bmxtools:latest
docker logout ghcr.io
```
* Run the [Build and Publish Image](../.github/workflows/publish-image.yml) workflow in GitHub actions on the release tag.
Loading