ci: build release targets from a shared matrix manifest#129
Open
g4bri3lDev wants to merge 1 commit into
Open
Conversation
Replace the ten copy-pasted per-target build blocks in release.yml with a single matrix job driven by .github/firmware-targets.json, shared with main.yaml so CI and release cannot disagree about the target list. The duplication had already drifted twice: - esp32-c3-N4 merged images were built with --chip esp32-c6 - esp32-N4 was built in CI but never released Also: cache pip/platformio, pin the toolchain (Core, esptool, nrfutil, intelhex, uf2conv) so a tag rebuilds identically, add permissions and timeouts, and gate asset upload on every target succeeding so a failed build can no longer leave a release with a partial asset set. Includes release-legacy.yml (arm A) for the A/B verification; temporary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the ten copy-pasted per-target build blocks in
release.ymlwith a single matrix job driven by a new.github/firmware-targets.json, shared withmain.yamlso CI and the release can no longer disagree about which targets exist or how they are packaged.Why: the duplication had already drifted twice
esp32-c3-N4merged images were built with the wrong chip.release.ymlsetpioenv=esp32-c3-N4but ranesptool.py --chip esp32-c6 merge_bin. That is not just a mislabel — byte0x3of the ESP32 image header packs flash size and flash frequency, and the frequency encoding is chip-specific:esp32-c3-N4_full.bin0x20(4MB, 40 MHz)0x2f(4MB, 80 MHz)esp32-c3-N16_full.bin0x4f0x4f(unchanged)So C3-N4 boards flashed with
_full.binhave been running their SPI flash at half speed. The correct value now matches the siblingesp32-c3-N16target. Only the merged image was affected; the plain.bincomes straight frompio run.esp32-N4was never released. It is inplatformio.iniand inmain.yaml, butrelease.ymlbuilt only 10 of the 11 targets, so plain ESP32-N4 boards got no release binaries at all. It is not a copy-paste of the others either: it is a classic ESP32, whose bootloader sits at 0x1000 rather than the 0x0000 used by S3/C3/C6, sobootloader_offsethad to become per-target data.Also in here
~/.platformio/.cacheand~/.cache/pip, matchingmain.yaml;release.ymlhad none.platformio==6.1.19,esptool==5.3.1,adafruit-nrfutil,intelhex, anduf2conv.pyat a commit. Each is the version an unpinned install resolved to on the day 2.25.1 was built, so this preserves the current toolchain rather than moving it.main.yamlis pinned to the same Core so CI predicts the release.permissions,timeout-minutes,actions/checkout@v6.Verification
A/B tested on a fork: the old workflow and the new matrix were run against the same commit, in the same window, and their artifacts diffed.
esp32-N4pair; identical sizes throughout;NRF52840.hexand.uf2byte-identical.esp_app_desc_ttime/datefields, a short string, andapp_elf_sha256. That is ESP-IDF build-timestamp non-determinism, not this change. In each_full.binthose regions sit at the.binoffsets +0x10000, confirmingmerge_binis a faithful concatenation.esp32-c3-N4_full.binis the sole file with extra differing regions — the header fix above.esp32-N4_full.binverified structurally:0xFFpadding through0x0-0xFFF, bootloader magic0xE9at0x1000.Wall clock went from 11m25s (serial) to 3m45s (parallel), while building one more target.
Not changed, deliberately
Six envs set
board_build.flash_mode=qioinplatformio.ini, but the workflow has always passed--flash_mode dio. That is preserved as-is: changing it would alter bytes for six targets with no hardware validation. Worth a separate look.esp32-N4has never been flashed to hardware — its parameters are correct by documentation, but it deserves one test flash before a release ships it.