Cookbook · 2 of 3
Build and release
In this tutorial we turn a working package into signed artifacts anyone can verify, built in CI. Two keys are involved and they do different jobs. Read about them before you copy the workflow.
- Two keys, made once: EC signs each package, usign signs the release manifest.
- Build both release lines:
25.12.5gives apk,24.10.8gives ipk. - Sign first, then write the manifest. The reverse order breaks the manifest.
- Run
owfeed checkon every pull request. It needs no secret.
| You want to | Go to |
|---|---|
| Create the signing keys | Make the two keys, once |
| Build for 25.12 and 24.10 | Build both release lines |
| Sign and write the manifest | Sign, then write the manifest |
| Copy a release workflow | GitHub Actions · GitLab CI |
| Check before you publish | Check it before anyone else does |
Make the two keys, once
owfeed keygen -o author.pem # EC prime256v1 — signs the packages owfeed keygen --usign -o release.key # usign/ed25519 — signs the release manifest gh secret set OWFEED_AUTHOR_KEY < author.pem gh secret set OWFEED_RELEASE_KEY < release.key git add author.pub.pem release.pub && git commit -m "publish the public halves"
owfeed keygen refuses to write inside one
without --force. Note the key ids it prints: a feed will ask for them.Why two
| Key | Signs | Checked by |
|---|---|---|
EC (author.pem) | inside each .apk | anyone, at any time, against your public half |
usign (release.key) | the release manifest | a feed, once, when it ingests your release |
The feed checks the usign signature at ingest, and then it is done. The signature never leaves the feed's CI.
The EC signature travels inside the package all the way to the router. Somebody who does not trust the feed can still confirm you built what they installed.
That is the one claim about a package that survives the feed serving it. That is why feeds require it.
Build both release lines
owlab build --release 25.12.5 # apk, for 25.12 and later owlab build --release 24.10.8 # ipk, for 24.10 and earlier
Both land in dist/<arch>/. An architecture-independent package produces two
directories:
dist/ ├── noarch/my-app-1.0.0-r1.apk └── all/my-app_1.0.0-r1_all.ipk
Two directories are correct. apk requires noarch and rejects all. opkg
has never heard of noarch.
Build both lines. Routers stay on a release for years, so shipping only 25.12 abandons everyone who has not upgraded.
luci.mk minifies JS and CSS; owlab sync does not. Code that works
unminified and breaks minified is invisible until somebody builds a package.Sign, then write the manifest
owfeed sign --key env:OWFEED_AUTHOR_KEY owfeed release --repo "$GITHUB_REPOSITORY" --tag "$GITHUB_REF_NAME"
Keep this order. owfeed release records every package's size and
sha256, and signing appends bytes. Reverse them and the manifest describes files that no longer
exist.
What the manifest records
owfeed release writes manifest.txt and signs it with your usign key. It
records:
- what belongs to this release;
- each file's size and hash;
- which repository and tag it came from.
It records the repository because a signature proves who wrote something, never what it is about. Without that line, a manifest lifted from another of your releases would verify perfectly as this one.
GitHub Actions
.github/workflows/release.yml
name: release
on:
push: { tags: ["v*"] }
permissions: { contents: read }
jobs:
release:
runs-on: ubuntu-latest
permissions: { contents: write }
steps:
- uses: actions/checkout@v5
- uses: owfeed/owlab/setup@v0.8.0
- uses: owfeed/owfeed/setup@v0.5.9
- run: owlab build --release 25.12.5
- run: owlab build --release 24.10.8
- name: Sign the packages, then write the manifest
env:
OWFEED_AUTHOR_KEY: ${{ secrets.OWFEED_AUTHOR_KEY }}
OWFEED_RELEASE_KEY: ${{ secrets.OWFEED_RELEASE_KEY }}
run: |
owfeed sign --key env:OWFEED_AUTHOR_KEY
owfeed release
- run: gh release create "${{ github.ref_name }}" --generate-notes
dist/*/*.apk dist/*/*.ipk dist/manifest.txt*
env: { GH_TOKEN: ${{ github.token }} }
owfeed release reads the repository and tag from the CI environment, so the flags
are only for overriding them:
| CI | Repository | Tag |
|---|---|---|
| GitHub | GITHUB_REPOSITORY | GITHUB_REF_NAME |
| GitLab | CI_PROJECT_PATH | CI_COMMIT_TAG |
environment:.GitLab CI
release:
rules:
- if: $CI_COMMIT_TAG
script:
- wget -qO- https://github.com/owfeed/owlab/releases/download/v0.8.0/owlab_0.8.0_linux_amd64.tar.gz | tar xz
- wget -qO owfeed https://github.com/owfeed/owfeed/releases/latest/download/owfeed-linux-amd64
- chmod +x owfeed && export PATH="$PWD:$PATH"
- owlab build --release 25.12.5
- owlab build --release 24.10.8
- owfeed sign --key env:OWFEED_AUTHOR_KEY
- owfeed release
Check it before anyone else does
owfeed check
owfeed check builds, signs, indexes and runs doctor --require-origin.
It uses an EC key and a usign key generated for the run and thrown away. It works in a temporary
directory and removes it afterwards.
Run it on every pull request. It needs no signing: block and no secret, so a fork's
code never runs beside a real key.
Run owfeed doctor on its own only when you have an indexed tree. It reads
out/ and otherwise stops with run owfeed index first. A
repository that publishes releases rather than a feed never produces that tree.
Findings that catch most first attempts
Findings are numbered. Each one says what it costs and what to do.
| Finding | What it means |
|---|---|
arch: all | apk rejects it as uninstallable. Use LUCI_PKGARCH:=all and let the build translate it. OpenWrt's own packaging does the same. |
| OWF207 | A /etc/config/* file is shipped but not in conffiles:. On every firmware upgrade, sysupgrade silently replaces the user's settings with your defaults. |
| Version rejected | After ~ apk reads a commit hash, so only hex. Write 1.0_beta1, not 1.0~beta. |
| Translations missing | LuCI reads compiled .lmo and ignores .po. Point i18n.from: at your catalogues. |