ci: mirror firmware's size-report sidecar (OpenIPC/firmware#2166) (#102)
Firmware PR #2166 added a `size-report` Makefile target + the `general/scripts/size_report.py` analyser that emits a per-package / per-kernel-module `sizes.<soc>-<variant>.json` next to the .tgz. Builder clones firmware fresh on every run and shells to `make BOARD=...`, so the script + target are already available downstream — this PR adds the CI wiring and manifest extension so the JSON ships as a release asset and surfaces through https://openipc.github.io/builder/manifest.json. Three changes: * `builder.sh`: best-effort `make size-report` after the main build, and copy `sizes.*.json` into the timestamped archive next to `.tgz` / `rootfs.squashfs.*`. Failure is swallowed so a legacy `OPENIPC_FW_REV` pin to a pre-#2166 firmware ref can't sink the build. * `.github/workflows/master.yml`: new `Build size report` step after the existing `Build firmware`. Mirrors the bimodal rename trick the .tgz path already does — compound matrix entries (`<soc>_<variant>_<vendor>-<model>`) share `<soc>_<variant>` and would otherwise collide on the firmware-side `sizes.<soc>-<variant>.json` filename when uploaded to the same release tag. Compound entries get the JSON renamed to `sizes.<NAME>.json`; simple entries keep `sizes.<soc>-<variant>.json`. `${{env.SIZES}}` is added to all three upload `files:` blocks (dated / nightly / latest). * `.github/scripts/enrich_manifest.py`: `SIZES_COMPOUND_RE` + `SIZES_SIMPLE_RE`, a `parse_sizes()` helper that tries compound first (because `[^._-]+` in the simple soc class would otherwise accept the compound form too), the sidecar is recorded at the platform level under a `"sizes"` key in `manifest.json`, and a new `@sizes <build_id> <platform> <size> <url>` line type is emitted in `manifest.flat` alongside the existing `@channel` directive. Schema is unchanged for existing consumers — on-device sysupgrade reads positional 4-column `manifest.flat` lines and stays inert on unknown `@`-prefixed directives. Co-authored-by: John <zekccsripfwrocp-15689@yn.furvionx.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
John
Claude Opus 4.7
parent
83faaad635
commit
da13271f94
@@ -57,6 +57,9 @@ copy_to_archive() {
|
||||
${FIRMWARE_DIR}/output/images/openipc.*.tgz \
|
||||
${BUILDER_DIR}/archive/${DEVICE}/${TIMESTAMP}
|
||||
|
||||
cp -a ${FIRMWARE_DIR}/output/images/sizes.*.json \
|
||||
${BUILDER_DIR}/archive/${DEVICE}/${TIMESTAMP} 2>/dev/null || true
|
||||
|
||||
if [ -f "${FIRMWARE_DIR}/output/images/autoupdate-kernel.img" ]; then
|
||||
cp -a ${FIRMWARE_DIR}/output/images/autoupdate* ${BUILDER_DIR}/archive/${DEVICE}/${TIMESTAMP}
|
||||
fi
|
||||
@@ -153,6 +156,11 @@ cp -afv ${BUILDER_DIR}/${ITEM}/* ${FIRMWARE_DIR}
|
||||
echo_c 33 "\nBuilding the device"
|
||||
make BOARD=${DEVICE}
|
||||
|
||||
# Best-effort: emit per-package/per-kernel-module size JSON next to the .tgz.
|
||||
# Target lives in firmware's Makefile (PR #2166); ignore failure so legacy
|
||||
# pinned firmware refs without the target don't sink the build.
|
||||
make BOARD=${DEVICE} size-report || true
|
||||
|
||||
copy_to_archive
|
||||
echo_c 35 "\nDone"
|
||||
cd "$BUILDER_DIR"
|
||||
|
||||
Reference in New Issue
Block a user