Skip to content

Add name-from-file input to name firmware after the YAML file - #198

Merged
Jesse Hills (jesserockz) merged 3 commits into
mainfrom
jesserockz-2026-798
Oct 28, 2026
Merged

Jesse Hills (jesserockz) merged 3 commits into
mainfrom
jesserockz-2026-798

Conversation

@jesserockz

Copy link
Copy Markdown
Member

Fixes #162.

Configs that share esphome.name and chip variant, such as hardware revisions of the same device, produce identical firmware file names and artifact names, so they collide. The only workaround was giving each config a different esphome.name, which also changes the device hostname.

This adds an opt-in name-from-file input to build.yml (and passes it through from build-to-draft-release.yml). When set, the firmware files and the artifact are named after the YAML file instead: the file name without its .yaml/.yml extension and a trailing .factory, with the chip variant still appended. For example my-device-rev-a.factory.yaml with name: my-device on an esp32c3 produces my-device-rev-a-esp32c3.factory.bin in artifact my-device-rev-a. The paths in manifest.json are rewritten to match, so the upload workflows need no changes. It also works with combined-name. With the input off, behaviour is unchanged.

CI gains two scenarios (standalone and combined) building two configs that share name: ci-revision, verifying the renamed binaries, that every manifest path resolves, and that no file keeps the original name.

Configs that share esphome.name and chip variant (e.g. hardware revisions)
produced identical firmware and artifact names and collided. name-from-file
names the files and artifact after the YAML file instead, rewriting the
manifest paths to match, so the device keeps its hostname.
CI Draft Release auto-discovers every *.factory.yaml, so the new test
configs were built there too. Use .factory.yml and plain .yaml instead,
which still covers both stem rules.
Rather than hiding the revision configs from the draft-release smoke test,
run its auto-discovery job with name-from-file so the pass-through to
build.yml is covered. ci-revision-a stays a discovered .factory.yaml and
ci-revision-b uses .factory.yml to keep both stem rules covered in ci.yml.
@jesserockz
Jesse Hills (jesserockz) merged commit e1432c7 into main Oct 28, 2026
54 checks passed
@jesserockz
Jesse Hills (jesserockz) deleted the jesserockz-2026-798 branch October 28, 2026 00:41
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.

How to build firmware for different hardware versions for the same CPU platform?

1 participant