openwrt-iac / uapi / docs / 4.0.1 / uapi release process
What ships, who signs what, where it lands. This document is operator-facing;
the high-level architectural contract lives in CLAUDE.md.
uapi is PKGARCH:=all (in build/openwrt/uapi/Makefile). The package
contains no compiled code - only ucode scripts and shell glue - so the same
uapi-<version>-<release>.apk is consumable by every OpenWrt host
architecture (x86_64, aarch64, arm, mips, etc.) at the same OpenWrt major
version. We do NOT build a separate APK per arch; the OpenWrt apk-tools
install handles arch-neutral packages directly.
The package job builds a single APK (against the x86_64 snapshot SDK of
OpenWrt main, because x86_64 is the simplest to host on GitHub runners) and
smoke-tests it in an x86 QEMU VM that boots the snapshot image of OpenWrt main,
and the release-apk job attaches that one artifact to the GitHub Release.
uapi 4.x supports OpenWrt main and the release cut from it, and not 25.12, so
no job of the 4.x line uses a 25.12 SDK or image. The v3 branch keeps its own
ci.yml, which builds and tests 3.x on 25.12. The apk feed itself is rebuilt by
openwrt-iac/openwrt-iac.github.io's publish.yml workflow, which
pulls the asset of the Release that GitHub marks Latest from each source
repo listed in its feed.yml. uapi no longer owns a gh-pages feed of its own.
The verify-arch-build matrix job cross-compiles against the SDKs for
aarch64_generic, arm_cortex-a7, and mips_24kc on tag push. It does
not prove arch-neutrality, despite what this said until 2.5.0: it
compares no digests and has no x86_64 leg to compare against. It uses
the snapshot SDKs of OpenWrt main, and fails the release, at an SDK
download, on sha256sums without a valid signature of the OpenWrt
snapshot key that build/openwrt-snapshot-usign.pub pins, on a tarball
that does not match those sums, on a cross-build that breaks under any
of the three, or on a build that produces no .apk. The matrix in
.github/workflows/ci.yml names the targets, and tools/openwrt-sdk.sh
resolves each SDK from the sha256sums of its target.
verify-arch-build also accepts workflow_dispatch, so you can validate
the snapshot SDKs against a candidate without tagging:
gh workflow run ci.yml --ref main
Use --ref v3 before a 3.x release. This fires the
unit + lint + integration + package + verify-arch-build
chain of a tag push, minus release-apk, which publishes, and minus the
signature check of package, which runs only on a tag ref.
The snapshot SDKs change daily, so run it on the day of the tag. A run
on main also saves the three SDKs in the cache, which a tag can restore
while the snapshot is the same. A tag saves none, because no other ref
can read a cache that a tag saves.
Operators who want a runtime per-arch smoke test (the CI matrix only
verifies compile) can run
tests/integration/release_apk_smoke.sh <path-to-apk> [<path-to-3.2.0-apk>]
against their own arch's QEMU VM or live router. With the second argument
it also upgrades from 3.2.0, the last release whose package shipped
/etc/config/uapi.
VERSION at the repo root drives every other version string:
build/openwrt/uapi/Makefile reads it via $(shell sed 's/-/_/g'
files/VERSION).build/gen_openapi.uc reads it and stamps info.version.src/main.uc reads it at parent VM startup; /healthz returns it.Bump VERSION, regenerate build/openapi.json via make openapi, commit.
Once a release number is on the table, sweep for work that belongs in it before cutting the branch. The point is not to pad the release: it is that the bracket the number implies is decided at that moment, and something eligible left behind usually waits a whole cycle, while something ineligible slipped in forces a retag.
Look at least at the open issues, the open PRs, docs/roadmap.md, and whatever
is already sitting under ## [Unreleased] in CHANGELOG.md. Also worth a
glance: docs/deprecations.md when a removal window has come due, and anything
previously parked as blocked upstream, since the blocker may have cleared.
Filter each candidate through the bracket in docs/versioning.md rather than by
how useful it is. A patch takes bug fixes with no surface change, plus the
carve-out for a tightening whose old behaviour produced state no caller could
rely on. A minor takes anything additive. Field deprecations are additive spec
surface and belong in a minor even when the fix they accompany is a patch.
Two things this catches, both seen in practice. Roadmap entries go stale: the hardening section once listed four items as outstanding that had all shipped, one of them a release earlier. And a fix can look patch-sized while carrying a minor-sized companion, which is how a header meant to report an apply outcome nearly rode along with the bug fix it belonged to.
Record the outcome even when it is empty. "Swept, nothing eligible" is worth saying, because the next reader cannot tell a sweep that found nothing from a sweep that never happened.
A major's breaking work lands on a preparation branch cut from main (v4
for 4.x), not on main itself. Breaking-change PRs target the preparation
branch. Additive and internal PRs keep targeting main and can ship in
minors while the major is in flight.
main: unit,
lint, integration, entry and package, with the branch up to date
before the merge (strict). Create the ruleset when the branch is created,
by copying the main ruleset and setting its name to
<branch>: required checks and its conditions.ref_name.include to
["refs/heads/<branch>"]. Every future major preparation branch gets the
same ruleset. The two rulesets differ in one thing: the main ruleset has
no bypass actor, so nobody can bypass it, and the preparation branch
ruleset lets the repository admin role bypass it (actor_type:
"RepositoryRole", actor_id: 5, bypass_mode: "always"). The checks stay
required on pull requests to the branch, and an admin can push the branch
directly for the rebases below (without the bypass, a ruleset on a branch
rejects direct pushes).main after every merge into main,
so breaking PRs start from a current base and conflicts stay small.main
(v3 for 3.x), with a copy of the main ruleset that has no bypass actor.
Rebase the preparation branch onto main one last time, merge it into
main, delete it and its ruleset, then run the release flow below. From then,
a fix of the old major lands on its maintenance branch by PR, and is carried
to main when it applies there. The old major's releases are tagged on its
maintenance branch. After such a tag, copy the new section of its
CHANGELOG.md into the one of main, and take out of the [Unreleased]
of main each entry that the section carries, so the released sections of
both branches carry the same entries. A carried entry keeps the number of
its main PR at its end (see Changelog below).v4 went through this on 2026-11-21: main carries 4.x, and v3 carries 3.x
from 3.5.0 on.
uapi cuts no release candidate while it has few declared users. Before a
major, the maintainers of the downstream clients, the Terraform provider and
uapi-mcp, review the migration guide and the spec of main. uapi fixes what
they report before the tag. An RC makes sense again when uapi is in the
official OpenWrt package feeds and has outside users.
The RC mechanism stays for that time. The release-apk workflow auto-detects
-rc/-alpha/-beta/-pre and marks the GitHub release as a prerelease (its
case "$TAG" in *-rc*|*-alpha*|*-beta*|*-pre*) PRE=--prerelease ;; block).
RCs do NOT publish to the apk feed. The feed aggregator at
openwrt-iac/openwrt-iac.github.io and its site take the GitHub Release
of each source repo that GitHub marks Latest, from gh release list
--exclude-pre-releases --exclude-drafts. Until
openwrt-iac/openwrt-iac.github.io#8 they took the newest release of that
list. A prerelease never carries the mark, and the list leaves it out at
the source. release-apk marks a stable release Latest only when its
version is the highest, so a 3.x release after 4.0.0 leaves the mark on
4.x. RCs go to the uapi GitHub
Release page only, marked --prerelease; operators who want to
install one download the APK from the release page and
apk add --allow-untrusted /tmp/uapi-<rc>.apk deliberately. Same
path the maintainer uses to dogfood the RC on the live router.
Per-release steps (operator does these in order). A 3.x release takes the
same steps on v3: its PR targets v3, its tag goes on v3, and each step
that names main names v3 for it.
release/v<version>. For a major, do the
downstream review above first.VERSION to the target value. Regenerate the OpenAPI:
make openapi. Commit.scripts/changelog-missing.sh
<previous-tag> <line>, where <line> is the branch that the release is
tagged on (main for 4.x, v3 for 3.x), and fix whatever it lists. On
that branch itself the script takes it as the default, and on a topic
branch it refuses to guess. Then rename ## [Unreleased]
to ## [x.y.z] - <date>, and put an empty ## [Unreleased] above it. The
release PR takes the changelog-not-needed label, because it moves
entries rather than adds one. Commit.make test coverage. The CI runs
make lint test-unit coverage plus the integration / soak / bench
suite, so a green local make test coverage is necessary but not
sufficient.package job, which the
change of VERSION triggers, so the APK and the upgrades from 3.2.0 are
tested before the tag exists. package is a required check, so a red
package blocks the merge. The bench measures and reports per-endpoint
p99; it does not gate, because no
baseline is committed. Read the numbers in the run log or the bench-run
artifact if a release is expected to move latency.main for 4.x, or into v3 for 3.x.git tag -s v2.0.0 -m "v2.0.0"
git push origin v2.0.0
The tag MUST be signed with a GPG key whose public block is in
.github/release-signers.asc. Set up once locally:
git config --global user.signingkey <YOUR-GPG-FINGERPRINT>
git config --global tag.gpgsign true
gpg --armor --export <YOUR-GPG-FINGERPRINT> > .github/release-signers.asc
git add .github/release-signers.asc && git commit -m "release: trust <fingerprint>"
git push
On a tag, CI's package job runs git verify-tag first; an unsigned tag (or a
tag from a signer not in the allowed list) fails package before it
builds anything, so release-apk creates no GitHub Release. Only the
Release is withheld: integration still uploads bench-run, and
verify-arch-build still uploads its per-arch APKs as workflow artifacts.package job runs (in order):
- tag signature verification
- resolution of the x86_64 snapshot SDK of OpenWrt main from its
sha256sums
- on a miss of the SDK cache, SDK download, with the signature of the
sha256sums checked against build/openwrt-snapshot-usign.pub and the
tarball checked against the sums
- make stage (populate build/openwrt/uapi/files)
- make package/uapi/compile in the SDK
- APK and SBOM upload as workflow artifacts
- VM smoke test (tests/integration/release_apk_smoke.sh) on the snapshot
image of OpenWrt main, including the upgrade from the 3.2.0 APKOnce package and integration pass, release-apk creates the GitHub
Release and attaches the APK and the SBOM (always; RCs get --prerelease).
9. Verify the release is visible on GitHub Releases. The feed at
openwrt-iac.github.io/feed/ picks up the new asset on its next
publish.yml run (nightly schedule or manual
gh workflow run publish.yml --repo openwrt-iac/openwrt-iac.github.io).
10. After a 3.x release, once 4.0.0 is out, check that 4.x keeps the Latest
mark.
gh release list must show Latest beside the highest 4.x release. The
feed and the site serve the release with the mark, so a 3.x release with
it puts 3.x on the feed in place of 4.x. If the 3.x release took the
mark, run gh release edit <4.x-tag> --latest and then the publish.yml
run above.
A release builds with the snapshot SDK of OpenWrt main of its day, or an
older one from the SDK cache. OpenWrt rebuilds the snapshot SDK daily
under the same name and deletes the previous one, so nobody can download
the SDK of a release again, and the APK bytes cannot be rebuilt from the
same SDK later. build/openwrt-snapshot-usign.pub pins the key that signs
the checksums of every snapshot SDK: CI checks that OpenWrt built the SDK,
not which build it was.
What a verifier can rebuild is the content of the package. The SBOM of a release lists the sha256 of each file that the APK installs:
git checkout v<version>
make stage # populate files/
make sbom # build/sbom.spdx.json, without the APK hash
The files of that SBOM must match the files of the SBOM attached to
the release. Only the creation time and the hash and size of the APK
differ: for 3.5.0, all 80 files match.
make sbom emits SPDX 2.3 JSON at build/sbom.spdx.json. The CI release
workflow generates the SBOM and attaches it to the GitHub Release
alongside the APK:
make sbom APK=$(find build/sdk/bin -name 'uapi-*.apk' | head -1)
gh release upload v2.0.0 build/sbom.spdx.json --clobber
The SBOM lists every shipped file's sha256, every package dependency
(uhttpd, uhttpd-mod-ucode, etc.), and the package itself with the
built APK's verification sha256. Operators using SBOM-aware deployment
tooling (cosign, syft, etc.) can consume it directly.
CHANGELOG.md follows Keep a Changelog:
an
## [Unreleased] section at the top, and one section per release below it. The
process is the
one Grafana Mimir uses: each PR writes its own entry, and CI checks that it did.
Every PR records its change in the same PR. It adds an entry under ##
[Unreleased], in the
heading that fits: Added, Changed, Deprecated, Removed, Fixed,
Security, or
Internal for release and build machinery. The entry ends with the PR number in
parentheses,
for example (#193). .github/workflows/changelog.yml runs
scripts/changelog-has-entry.sh
and fails the PR when no entry under ## [Unreleased] carries its number.
An entry is needed for every change that someone outside the repo can see:
the wire
surface, the behavior on the router, the package, or the release artifacts (APK,
SBOM, GitHub
Release). A PR that changes none of these takes the changelog-not-needed label
instead. The
entry job still runs on that PR, reads the label from the API and passes. That
covers docs,
tests, CI that changes no artifact, refactors, and release PRs.
The entry says why, not only what. It names the defect or the need, what
changed on the
wire, and what a client must do, if anything. A breaking change opens with
BREAKING:. A
tightening under a carve-out in docs/versioning.md names the carve-out and
says how loudly it
fails. This is why entries are not generated from PR titles, as release-please
does in Grafana
Loki and Alloy: a title cannot carry that.
The PR number exists only once the PR does. Either open the PR and then push
the entry, or
predict the number with scripts/next-pr-number.sh before you open it. Issues
and PRs share one
counter, so the guess is wrong if an issue opens in between, and the check then
fails until the
entry carries the real number.
At release time, scripts/changelog-missing.sh <previous-tag> <line>
lists every PR merged into <line> since that tag that has neither an entry
nor the label: main for 4.x, v3 for 3.x. It must print nothing. Step 3
above then turns ## [Unreleased] into the release section, and
scripts/release-notes.sh makes that section the GitHub Release body.
A change carried between main and v3 has a PR on each branch, and its
entry keeps the number of the main PR at its end:
(#<v3 PR>) (#<main PR>). When the v3 PR merges first, the main number
joins the entry where the 3.x section is copied into main. The sweep of each
branch then finds its own PR, and the sweep of main still finds it after the
copied section replaces the entry in its [Unreleased].
Before this process, entries were written at release time from memory. Between 3.0.0 and the first PR the check covered, nine PRs merged and none of them added an entry.
Before tagging:
main, and what they reported
is fixed.VERSION matches the target tag.build/openapi.json's info.version matches (make openapi-check).scripts/changelog-missing.sh <previous-tag> <line> prints nothing
(main for 4.x, v3 for 3.x), and ## [Unreleased] is renamed to this
version.docs/deprecations.md carries a target release in its "Deprecated since"
column before that release exists, and the roadmap names target versions
too. Both go stale the moment a number moves or a scope slips, which is how
the commit-confirm plan ended up still naming 2.4.0 after 2.4.0 shipped
without it. Grep the docs for the version being cut and for the one before
it.make test coverage green.main for 4.x, v3 for 3.x, release/<major>.<minor>.x for a patch on an
older major. All three are built on push..github/release-signers.asc contains your GPG public key block.build/openwrt/uapi/Makefile is above
the netifd of the openwrt-25.12 branch of OpenWrt (docs/packaging.md,
The netifd floor).gh workflow run ci.yml --ref main green (--ref v3 for 3.x) -
validates the per-arch SDKs via verify-arch-build without consuming a
tag.After tagging, before announcing:
gh workflow run publish.yml --repo
openwrt-iac/openwrt-iac.github.io (or wait for the nightly schedule) and
confirm
apk update against openwrt-iac.github.io/feed/... finds the new
version. For an RC or a 3.x release after 4.0.0,
confirm the opposite instead, that apk policy uapi still offers the
release that the feed served before (step 10 above). The aggregator
takes only the stable release marked Latest, so an RC or a 3.x release
on the feed is the bug.If a tagged release is broken in the field:
gh release edit <tag> --prerelease to demote it in the UI. Then mark the
highest good release of the same major Latest, such as
gh release edit v4.0.0 --latest when 4.0.1 is broken, also when a 3.x
release came after 4.0.1. The aggregator takes the release marked Latest
on its next run.vX.Y.(Z+1) patch with the fix. release-apk marks it Latest
when it is the highest version, and the next aggregator run then picks it
up and signs a fresh packages.adb.apk upgrade uapi
resolves to the patched version once the feed updates.The current arch-neutrality contract depends on PKGARCH:=all in
build/openwrt/uapi/Makefile (pure ucode + shell). If a future change
adds a C component:
PKGARCH:=all from the package Makefile.package from a single job into a matrix over arch (same
matrix verify-arch-build uses today), and have release-apk attach
every APK.This is documented in case the principle is ever revisited; the architectural intent is that it should not be.