Skip to content

Commit b942bd5

Browse files
authored
Tag releases with Brussels (#2270)
The first phase of the SP and RoT release process is to determine the version number, tag the latest commit with that version number, and push it to kick off the build. To start fully automating the SP release process, this PR replaces this phase with a single GitHub Actions workflow that can be started through the UI: <img width="933" height="477" alt="image" src="https://github.com/user-attachments/assets/2fb0b680-b4ac-41d7-a37a-6455bafd4735" /> <br/><br/> This uses [Brussels](https://github.com/oxidecomputer/brussels), the new SP and RoT release tooling I'm working on, and in particular the changes I introduced in oxidecomputer/brussels#3. Brussels is fetched as a pre-built binary from its GitHub Release to ensure it doesn't delay the release process by trying to compile it. The `brussels init` command will be executed in its own job as the first build step. It will look at all the existing tags to determine what is the next version number, calculate the tag name, and expose all of that information into `GITHUB_OUTPUT` to let the rest of the workflow know the version to use. It will also write all the metadata it gathered in a `brussels-manifest.json` file, so that future Brussels steps can reference that metadata. The tag will not be created and pushed by `brussels init`. Instead, we will let the "create GitHub Release" step at the end of the workflow create the tag on its own, as GitHub will do so when creating a release without an underlying tag. While I was there, I also changed the build process to inject the version number directly during the build, instead of waiting for permslip to add it as part of the signature process. This is just the first improvement to the SP release process that I'm going to do. The end goal is for SP releases to be fully automated (either by requiring a single button click or by putting the whole release process in a cronjob). Note that by default the workflow will use the latest release of Brussels. An optional field when starting the workflow run lets you download Brussels from a CI job in the Brussels repository. This mostly exists to help me test changes without publishing endless releases.
1 parent 2a73694 commit b942bd5

3 files changed

Lines changed: 83 additions & 106 deletions

File tree

.github/workflows/build-boards.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ on:
2121
required: false
2222
default: false
2323
type: boolean
24+
caboose-version:
25+
description: Version number to insert in the caboose
26+
required: false
27+
default: ""
28+
type: string
2429

2530
# Force permissions to be defined at the job level.
2631
permissions: {}
@@ -43,7 +48,7 @@ jobs:
4348
run: build/gha-build-boards-matrix.py ${filter_directories} --write-github-output
4449
id: matrix
4550
env:
46-
filter_directories: ${{ inputs.filter_directories }}
51+
filter_directories: ${{ inputs.filter-directories }}
4752

4853
build:
4954
needs:
@@ -88,9 +93,17 @@ jobs:
8893
${{ runner.os }}-vcpkg-download-
8994
9095
- name: cargo xtask dist
96+
run: |
97+
# GitHub Actions defaults the environment variable to an empty string when missing.
98+
if [[ "${HUBRIS_CABOOSE_VERS}" == "" ]]; then
99+
unset HUBRIS_CABOOSE_VERS
100+
fi
101+
cargo xtask dist "${app_toml}"
102+
shell: bash
91103
env:
104+
app_toml: ${{ matrix.app_toml }}
105+
HUBRIS_CABOOSE_VERS: ${{ inputs.caboose-version }}
92106
RUST_BACKTRACE: 1
93-
run: cargo xtask dist ${{ matrix.app_toml }}
94107

95108
- name: Fetch Humility
96109
uses: dsaltares/fetch-gh-release-asset@master

.github/workflows/release-builds.yml

Lines changed: 0 additions & 80 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 68 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,92 @@
1-
name: release
1+
name: Release
22
on:
3-
workflow_call:
3+
workflow_dispatch:
44
inputs:
5-
board-set:
6-
description: "Which set to build"
7-
required: true
8-
type: string
9-
filter-directories:
10-
description: Space-separated list of directories to build.
5+
group:
6+
description: Boards group
117
required: true
8+
type: choice
9+
options:
10+
- all-sp
11+
- rot
12+
brussels-run-id:
13+
description: Download Brussels from a Run ID
1214
type: string
1315

16+
# Prevent multiple releases for the same group from happening concurrently.
17+
concurrency:
18+
group: release-${{ github.event.inputs.group }}
19+
1420
jobs:
15-
do-build:
21+
init:
22+
name: Initialize the release
23+
runs-on: ubuntu-24.04
24+
outputs:
25+
version: ${{ steps.init.outputs.version }}
26+
tag_name: ${{ steps.init.outputs.tag_name }}
27+
hubris_app_dirs: ${{ steps.init.outputs.hubris_app_dirs }}
28+
steps:
29+
- &download-brussels
30+
name: Download Brussels
31+
run: |
32+
if [[ "${BRUSSELS_RUN_ID}" == "" ]]; then
33+
gh release download -R oxidecomputer/brussels -p brussels
34+
else
35+
gh run download "${BRUSSELS_RUN_ID}" -R oxidecomputer/brussels -n prebuilt-binary
36+
fi
37+
sudo mv brussels /usr/local/bin
38+
sudo chmod +x /usr/local/bin/brussels
39+
env:
40+
GH_TOKEN: ${{ secrets.BRUSSELS_TEMPORARY_TOKEN }}
41+
BRUSSELS_RUN_ID: ${{ github.event.inputs.brussels-run-id }}
42+
43+
- id: init
44+
name: Initialize the release
45+
run: brussels init $group >> brussels-manifest.json
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
group: ${{ github.event.inputs.group }}
49+
50+
- name: Upload the release manifest
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: brussels-manifest
54+
path: brussels-manifest.json
55+
if-no-files-found: error
56+
57+
build:
58+
name: Build boards
59+
needs:
60+
- init
1661
uses: ./.github/workflows/build-boards.yml
1762
with:
1863
os: oxide-colo-builder-hubris
19-
filter-directories: ${{ inputs.filter-directories }}
64+
filter-directories: ${{ needs.init.outputs.hubris_app_dirs }}
2065
upload-artifacts: true
66+
caboose-version: ${{ needs.init.outputs.version }}
2167
attest: true
2268

23-
release-build:
24-
needs: do-build
69+
release:
70+
name: Publish the release
71+
needs:
72+
- init
73+
- build
2574
runs-on: oxide-colo-builder-hubris
2675
steps:
27-
- name: grab binary
76+
- name: Download all artifacts to release
2877
id: grab
2978
uses: actions/download-artifact@v4
3079
with:
3180
path: out
32-
- name: prep
33-
run: |
34-
OUT=${{ steps.grab.outputs.download-path }}
35-
for build in `ls $OUT`; do
36-
for f in `ls $OUT/$build`; do
37-
mv $OUT/$build/$f $OUT/$f
38-
done
39-
done
81+
merge-multiple: true
4082

41-
- name: cut release
83+
- name: Publish the release
4284
uses: softprops/action-gh-release@v1
4385
with:
44-
name: "${{ inputs.board-set }} release"
86+
tag_name: ${{ needs.init.outputs.tag_name }}
87+
name: "${{ github.event.inputs.group }} release"
4588
fail_on_unmatched_files: true
46-
body: "These are UNVERSIONED hubris artifacts"
89+
body: "These are versioned but UNSIGNED hubris ${{ github.event.inputs.group }} artifacts"
4790
files: |
4891
${{ steps.grab.outputs.download-path }}/*.zip
92+
${{ steps.grab.outputs.download-path }}/brussels-manifest.json

0 commit comments

Comments
 (0)