ci: adopt release-please for firmware releases - #130
Merged
Conversation
Releases are cut by merging a release PR: release-please maintains the version manifest and CHANGELOG.md from conventional commits and creates the GitHub release, tagged bare (2.26.0 — not v2.26.0, not Firmware-2.26.0) to match every existing tag, the website's sort -V freshness check, and the HA integration's OTA asset lookup. A release created with GITHUB_TOKEN does not emit release:published, so release.yml gains a workflow_call trigger and release-please.yml invokes it gated on release_created; the calling job grants contents:write, since a called workflow cannot hold more permissions than its caller. The release:published trigger is kept so publishing by hand still builds, and workflow_dispatch gives a recovery path for re-running a failed build. Also drops release-to-discord.yml: it has no DISCORD_WEBHOOK_URL secret and has failed on every release since 2.24.1.
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.
Adopts release-please for this repo, per the
#support-forumSemVer thread.Stacked on #129 (the matrix refactor) — that is its base branch, so review this diff alone. GitHub will retarget it to
mainonce #129 merges.Releases become: merge conventional commits → review the release PR → merge it → tag, CHANGELOG, build and asset upload all happen automatically.
Tags stay bare
include-v-in-tag: falseandinclude-component-in-tag: false. Both matter — three separate consumers parse these tags:sync-firmware-release.shon the website compares tags withsort -Vto decide if a release is newer, and writes the raw tag intohttpdocs/firmware/toolbox/bin/*_full.jsonas.version, which esp-web-tools compares against the running device.releases/latesttag_nameforinstalledvslatest, and builds OTA asset filenames from it.The part that is easy to get wrong
A release created with
GITHUB_TOKENdoes not emitrelease: published. All the real work here hangs off that event, so a naive adoption would cut tags that build nothing and attach no assets — and the website's nightly sync would then advertise them.So
release.ymlgains aworkflow_calltrigger andrelease-please.ymlinvokes it directly, gated onrelease_created. The calling job grantscontents: write, because a called workflow cannot hold more permissions than its caller.release: publishedis kept so publishing by hand still builds, andworkflow_dispatchgives a recovery path for re-running a failed build against an existing tag.Also drops
release-to-discord.ymlIt is not merely unused: it fires on every release and fails every time for want of a
DISCORD_WEBHOOK_URLsecret — 2.25.1, 2.25.0, 2.24.4, 2.24.2, 2.24.1 are all red. Re-add it later with the secret, chained after the build.Verified end to end on a fork
fix:commit → release PR2.25.2(compare/2.25.1...2.25.2) → merge → bare tag2.25.2→release_created→workflow_call→ 11-target matrix → 23 assets attached.The decisive evidence is a run that does not exist: the run list showed only
event=pushandevent=pull_request, noevent=releaseat all. Without this wiring, 2.25.2 would have been a published release with zero binaries.Two bugs were caught by that test and are already fixed here: the caller-permissions startup failure, and
package-namecausing component-prefixed tags (Firmware-2.26.0) which also made release-please miss the prior release, walk the whole history, and propose a bogus minor bump fromfeat:commits already shipped in 2.24.Before merging
Worth also making the PlatformIO CI check required on PRs: the release PR is an ordinary PR, so a compile break would then block the merge and no tag is ever cut.