openwrt-iac / uapi / docs / 3.5.0 / uapi release process

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.

Architecture neutrality

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 SDK because that's the simplest to host on GitHub runners) and smoke-tests it in an x86 QEMU VM, and the release-apk job attaches that one artifact to the GitHub Release. The apk feed itself is rebuilt by openwrt-iac/openwrt-iac.github.io's publish.yml workflow, which pulls the latest stable Release asset 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 fails the release on a missing per-arch SDK pin, a tarball that does not match its pin, a cross-build that breaks under any of the three, or a build that produces no .apk - which is what 2.4.1 actually relied on. Per-arch SDK tarball sha256 lives in build/sdk.sha256; refresh those lines whenever OPENWRT_VERSION bumps (the matrix in .github/workflows/ci.yml names the targets, and tools/openwrt-sdk.sh resolves each URL from the pin).

Pre-tag arch validation

verify-arch-build also accepts workflow_dispatch, so you can validate the SDK pins against a candidate without tagging:

gh workflow run ci.yml --ref main

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. Useful right after bumping OPENWRT_VERSION to confirm the new per-arch sha256 lines actually match upstream.

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.

Versioning

VERSION at the repo root drives every other version string:

Bump VERSION, regenerate build/openapi.json via make openapi, commit.

Candidate sweep before a version number is fixed

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.

Major preparation branch

A major's breaking work lands on a preparation branch cut from main (today v4), 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.

Release flow

Major versions ship as -rc first

For any MAJOR bump, tag vX.0.0-rc1 (or -rc2, etc.) BEFORE the final vX.0.0. 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 pulls each source repo's latest stable GitHub Release via gh release list --exclude-pre-releases; prereleases are filtered out at the source. 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.

Announce the RC explicitly to known downstream consumers - the openwrt-iac/uapi Terraform provider author, anyone with a published client - and give them a ~1-2 week window to file wire-surface feedback. Promote rc<N> to the final vX.0.0 only after the window closes with no fundamental issues outstanding. v2.0.0 went straight to stable and immediately surfaced material provider-side feedback; this rule exists to convert that "post-release scramble" into "pre-release polish".

Skip RCs for MINOR or PATCH unless the change set is unusually large.

Per-release steps (operator does these in order):

  1. Cut a release candidate branch if the release is substantive (v2.0.0-rc1). For patch releases, just work on a topic branch.
  2. Update VERSION to the target value. Regenerate the OpenAPI: make openapi. Commit.
  3. Close the changelog section. Run scripts/changelog-missing.sh <previous-tag> and fix whatever it lists. Then rename ## [Unreleased] to ## [x.y.z] - <date>, and put an empty ## [Unreleased] above it. Do this for rc releases too. A final release after RCs gets a short section of its own that points at the RC sections, as 3.0.0 does. The release PR takes the changelog-not-needed label, because it moves entries rather than adds one. Commit.
  4. Run the full test suite locally: 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.
  5. Open PR, get CI green: lint + unit + coverage gate + integration + soak (RSS/fd growth thresholds) + bench, and the 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.
  6. Merge to main.
  7. Sign and push the tag: 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.
  8. Watch the tag's CI run. The package job runs (in order): - tag signature verification - reproducible-SDK pin check (against build/sdk.sha256) - SDK download + sha256 verify, on a miss of the SDK cache - 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), including the upgrade from the 3.2.0 APK

Once 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).

Reproducible builds

The SDK pin in build/sdk.sha256 records the exact OpenWrt SDK tarball URL + sha256 used for the release. CI verifies the checksum before unpacking. An independent verifier can:

sha256sum -c build/sdk.sha256             # verify the SDK was the expected one
make stage                                # populate files/
( cd build/sdk && make package/uapi/compile )
sha256sum bin/packages/all/uapi-*.apk     # compare against the released APK

The build is deterministic: file ordering in the APK is sorted; the package Makefile sets PKG_RELEASE so the version string doesn't change between local and CI builds; BUILD_DATE can be overridden in CI if needed for fully byte-identical builds.

SBOM

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

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> lists every PR merged into main since that tag that has neither an entry nor the label. 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.

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.

Pre-release verification checklist

Before tagging:

After tagging, before announcing:

Rollback

If a tagged release is broken in the field:

  1. Identify the breakage; file an issue.
  2. Mark the GitHub Release as "Pre-release" or "Draft" via gh release edit <tag> --prerelease to demote it in the UI. The aggregator's --exclude-pre-releases filter then pulls the next-highest stable on its next run.
  3. Ship a vX.Y.(Z+1) patch with the fix; the next aggregator run picks up the higher version and signs a fresh packages.adb.
  4. The broken APK doesn't necessarily get re-served (it's only on GitHub Releases at that point); operators who already installed the broken version aren't auto-downgraded, but apk upgrade uapi resolves to the patched version once the feed updates.

If uapi ever grows compiled code

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:

  1. Drop PKGARCH:=all from the package Makefile.
  2. Convert package from a single job into a matrix over arch (same matrix verify-arch-build uses today), and have release-apk attach every APK.
  3. The smoke test still only runs on x86_64 (the QEMU image we host); add per-arch QEMU images if real runtime coverage matters.
  4. Plan for ~4x package runtime.

This is documented in case the principle is ever revisited; the architectural intent is that it should not be.