Skip to content

ci: publish u-boot artifacts to OpenIPC/firmware on master - #12

Merged
widgetii merged 4 commits into
masterfrom
ci/publish-uboot-to-firmware
May 5, 2026
Merged

ci: publish u-boot artifacts to OpenIPC/firmware on master#12
widgetii merged 4 commits into
masterfrom
ci/publish-uboot-to-firmware

Conversation

@widgetii

@widgetii widgetii commented May 5, 2026

Copy link
Copy Markdown
Member

Summary

  • After both matrix builds succeed on a push to master, upload u-boot-hi3516av200-universal.bin and u-boot-hi3519v101-universal.bin (1 MiB-padded, matching build.sh output) to the latest release in OpenIPC/firmware.
  • Build step now also runs the dd ... bs=1M conv=sync padding so the CI artifact's contents and name match what gets published. Previously the artifact was named u-boot-<soc>-universal but contained raw mini-boot.bin.
  • New publish job is gated to push events on refs/heads/master, so PR builds don't try to publish.

Required setup before merge

Create a fine-grained PAT scoped to OpenIPC/firmware with Contents: Read and write, then add it to this repo's Actions secrets as FIRMWARE_RELEASE_TOKEN:

  1. https://github.com/settings/personal-access-tokens/new
  2. Resource owner: OpenIPC · Repository access: Only select repositories → OpenIPC/firmware · Permissions → Repository permissions → Contents: Read and write
  3. Add the token as a secret: gh secret set FIRMWARE_RELEASE_TOKEN -R OpenIPC/u-boot-hi3519v101 --body '<token>'

Without the secret, the publish job fails fast (gh: 401) but build still passes.

Test plan

  • CI on this PR: both build (hi3516av200) and build (hi3519v101) are green and produce a ~1 MiB u-boot-<soc>-universal.bin artifact each.
  • publish job is skipped on this PR (event_name == pull_request).
  • After merge to master with the secret in place: publish runs once both builds finish; the two assets in OpenIPC/firmware latest release get replaced (--clobber) with fresh, identically-named binaries.
  • If the secret is missing or wrong, publish fails clearly without affecting build status of master.

John-1 and others added 3 commits May 5, 2026 19:51
After both matrix builds succeed on a push to master, upload
u-boot-hi3516av200-universal.bin and u-boot-hi3519v101-universal.bin
(1 MiB-padded, matching build.sh output) to the 'latest' release in
OpenIPC/firmware via gh release upload --clobber.

Build step now also produces the 1 MiB-padded universal binary so the
CI artifact name and contents match the published asset name.

Requires repo secret FIRMWARE_RELEASE_TOKEN: a fine-grained PAT scoped
to OpenIPC/firmware with Contents: read and write.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Document the failure modes a future debugger will hit first: missing/
expired/under-scoped FIRMWARE_RELEASE_TOKEN, deleted 'latest' tag in
OpenIPC/firmware, and missing build artifacts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The hi3516av200 release asset becomes the raw mini-boot.bin (~199 KB).
Padding to NAND erase-block size happens in defib (the recovery tool
that consumes this asset) so we don't bake a flash-geometry assumption
into the boot image. hi3519v101 keeps the 1 MiB padding it had.

Apply the same change to build.sh so local builds match the published
artifact byte-for-byte.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Apply the consumer-pads principle to hi3519v101 too, not just
hi3516av200. Both u-boot-${soc}-universal.bin assets are now the raw
LZMA self-extractor output; the recovery tool (defib) is responsible
for padding to the target flash erase-block size before writing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@widgetii
widgetii merged commit 9998bfd into master May 5, 2026
3 checks passed
@widgetii
widgetii deleted the ci/publish-uboot-to-firmware branch May 5, 2026 17:15
widgetii added a commit that referenced this pull request May 5, 2026
## Summary

- The first `publish` run after PR #12 merged failed because the GitHub
Releases API returned a 502 "Unicorn!" page on the very first `gh
release upload` call. A manual re-run worked. Add retry to make this
self-heal.
- Wrap `gh release upload` in a 5-attempt loop with linear backoff (10s,
20s, 30s, 40s — ~100s total before giving up). Real auth/scope failures
still fail the job; they just take longer to surface.

## Test plan

- [ ] PR build (no publish) stays green.
- [ ] After merge, normal master push uploads both assets on the first
attempt as before.
- [ ] Manual sanity: temporarily point the upload at a bogus release
tag; confirm 5 attempts then fail.

Co-authored-by: john-1 <john-1@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants