Skip to content

ci(firmware): build and attach firmware release assets (#360) - #368

Merged
mottihoresh merged 5 commits into
mainfrom
ci/release-assets-360
Oct 25, 2026
Merged

mottihoresh merged 5 commits into
mainfrom
ci/release-assets-360

Conversation

@mottihoresh

@mottihoresh mottihoresh commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #360.

What

Every firmware release gets prebuilt firmware attached, built by CI from the release tag.

  • New reusable workflow .github/workflows/firmware-release-assets.yml (workflow_call only)
    • Called with the release tag and publish: true by release-please.yml (new firmware-assets job, beside firmware-dependencies) — the only path that publishes (gh release upload --clobber).
    • Called with no tag by .github/workflows/firmware-release-assets-check.yml on pull requests (the two workflows + Firmware/release/**) — validation only: build, flash/RAM table per board in the job summary, package uploaded as an Actions artifact (14 days). No manual trigger.
    • Always builds the caller's own commit, never a passed-in ref. On the release path that is the push that merged the release PR — the commit release-please tags; the build fails if the tag points elsewhere.
  • Boards: Gateway — Templates/SimGateway (.uf2) + Templates/PanelBridge; Panels/PDU_Left|Right|Center. Center_Armament left out (deprecated board).
  • Flat release files (client): manifest.json, gateway-<v>.uf2, gateway-bridge-<v>.bin, pdu-left|right|center-<v>.bin.
  • Zip (people): openskyhawk-firmware-<v>/ — top README / CHANGES / LICENSE / manifest, then a folder per board with its README and .elf (STM32, flash address built in) or .uf2 (RP2040).
  • README templates in Firmware/release/ (top, Gateway, STM32 node), filled with envsubst. GPL note points at the release's source archive.
  • PanelBridge template → genericSTM32F103C8, the MCU on the Gateway board (the docs already said C8). Links at 31,348 B (47.8%).
  • docs/architecture/design-decisions.md: one bullet on what a firmware release carries.

Checked locally (before this PR)

All five projects build from this branch; the workflow's packaging script, extracted from the YAML and run against those builds, produced the expected flat files, zip tree and READMEs, and every manifest SHA-256 matches its file (sha256sum -c).

Board Flash RAM
Gateway (USB side) 95,812 / 2,093,056 B (4.6%) 18,304 / 262,144 B (7.0%)
Gateway (cockpit side) 31,348 / 65,536 B (47.8%) 4,260 / 20,480 B (20.8%)
PDU Left / Right / Center 31,860 / 64,512 B (49.4%) 2,632 / 20,480 B (12.9%)

Not covered here

BEGIN_COMMIT_OVERRIDE
ci(firmware): build and attach firmware release assets (#360)
fix(firmware): PanelBridge template builds for the STM32F103C8 on the Gateway (#360)
END_COMMIT_OVERRIDE

… Gateway

The Gateway PCB carries an STM32F103C8, and the variant policy and docs
already name the C8 for PanelBridge; only the template still targeted the
CB. PanelBridge links at 31,348 B (47.8% of the C8). The library README
named the CBT6 too.

Refs #360
A reusable workflow builds the stock firmware - the Gateway (SimGateway
.uf2 + PanelBridge) and the three PDU nodes - from the release tag and
attaches it to the firmware release: one .bin/.uf2 per board plus
manifest.json (size, SHA-256) for tools, and a zip with a folder per
board, .elf files and READMEs (from Firmware/release templates) for people.

release-please.yml calls it with publish: true once a firmware release
exists. Pull requests touching the workflow or the templates, and manual
runs, only validate: they build, put a flash/RAM table per board in the job
summary and upload the package as an Actions artifact.

Closes #360
… typed one

CodeQL flagged the workflow_dispatch ref input: a manual run checked out
whatever ref was typed in. Drop the input; a manual run now builds the
branch or tag picked in "Use workflow from", and only the release call
(tag from release-please) passes a ref.

Refs #360
…separate caller

CodeQL's cache-poisoning check still flagged the checkout: in a workflow
that also has a workflow_dispatch trigger, any inputs.ref checkout counts as
dispatch-controlled. The build workflow now has only workflow_call;
pull-request and manual validation runs live in
firmware-release-assets-check.yml, which calls it without a ref. The ref it
checks out only ever comes from release-please.

Refs #360
…d-in ref

CodeQL kept flagging the inputs.ref checkout as dispatch-controlled. The
release path doesn't need it: the release job runs on the push that merged
the release PR, which is the commit release-please tags. The input is now
'tag' and only names the files and the release; the build fails if the tag
doesn't point at the commit it built.

The validation workflow drops its manual trigger: pull requests already
cover iterating on the package.

Refs #360
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(firmware): build and attach firmware release assets

2 participants