Skip to content

build(package): ship precompressed assets as an optional package, add apk packages - #449

Merged
Zakkaus merged 3 commits into
mainfrom
feat/package-precompress
Oct 4, 2026
Merged

Zakkaus merged 3 commits into
mainfrom
feat/package-precompress

Conversation

@Zakkaus

@Zakkaus Zakkaus commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Ships the .br and .gz siblings of the text assets as an optional package instead of adding them to the main archive, and adds Alpine and OpenWrt 25.12 apk packages to releases.

Precompressed assets

  • tools/package.sh writes the siblings (brotli -q 11, gzip -9 -n, text assets of at least 1 KiB, kept only when smaller) into a separate, reproducible doona-precompressed-<version>.tar.gz. The program archive is byte-identical to the one main produces; the fonts archive too.
  • New package doona-precompressed (doona-web-precompressed for the deb) for deb, rpm, ipk and Arch via install/nfpm/doona-precompressed.yaml, as an APKBUILD subpackage and in the OpenWrt Makefile. It installs into doona's directory and contains only the sibling files. The nfpm packages depend on exactly the same doona version per format (checked: dpkg, rpm, pacman and opkg metadata; rpm needs its own doona = <v> form). The OpenWrt Makefile depends on doona without a version, because its DEPENDS syntax rejects a version condition; all three come from one source build there.
  • Sizes, run 37187597277: main ipk 1,261,127 B and deb 1,264,694 B (unchanged), precompressed archive 1,632,919 B, ipk 1,635,401 B.

apk packages in CI

  • alpine: tools/package-alpine.sh runs abuild with install/alpine/APKBUILD in alpine:3.24.2 (pinned by digest) against the archives of the run. It builds doona, doona-doc, doona-fonts and doona-precompressed, signed with a key made by abuild-keygen -n for this run. The public key is attached as doona-alpine.rsa.pub.
  • openwrt-apk: tools/package-openwrt.sh builds install/openwrt/doona/Makefile in openwrt/sdk:x86-64-25.12.5 (pinned by digest; the packages are PKGARCH all). The local archives in dl/ replace the downloads. The OpenWrt SDK does not sign individual apk files, only the index, so the release attaches the signed index as doona-openwrt.adb and the run's public key as doona-openwrt.pem. You can install with that key (apk add -X <dir>/doona-openwrt.adb doona) or with apk add --allow-untrusted ./doona-*.apk.
  • Checked locally: Alpine 3.24 install and removal with the key; OpenWrt 25.12 rootfs: unsigned files are refused, --allow-untrusted works, and key plus index works.

Workflow

  • The jobs run in parallel after build: nfpm (deb, rpm, ipk, Arch), alpine and openwrt-apk. nfpm stays one job rather than a matrix: the four formats take seconds, so a matrix would add four job start-ups and split the renaming across them.
  • sums merges the artifacts and writes SHA256SUMS over every asset. release needs all of them and still runs no commands.
  • workflow_dispatch packages package.json's version from a branch and skips verified and release; the files stay as run artifacts. A tag push runs as before, plus the new jobs.

Test run: https://github.com/Zakkaus/doona/actions/runs/37187597277 (success; 35 entries in SHA256SUMS, all verified).

Checks: pnpm check, actionlint, shellcheck, sh -n/bash -n, tools/ci-workflows.test.mjs.

A server hosting doona's directory, including honk's UI hosting, can only
send compressed responses when the text assets carry .br and .gz siblings.
Shipping them inside the program archive would grow every install,
including routers, so tools/package.sh now writes them to a separate
reproducible archive, doona-precompressed-<version>.tar.gz, and leaves
the program archive byte-identical to before.

Each sibling is brotli -q 11 or gzip -9 -n of a text asset of at least
1 KiB, kept only when smaller. The new nfpm config, the APKBUILD
subpackage and the OpenWrt package install the siblings into doona's
directory and depend on doona; nfpm pins the same doona version per
format.
@Zakkaus
Zakkaus force-pushed the feat/package-precompress branch from 8007ef7 to 934e770 Compare October 4, 2026 07:56
nfpm's apk output is rejected by apk-tools, so Alpine and OpenWrt 25.12
users had no package. Two new jobs build them from the existing recipes
against the archives of the same run: tools/package-alpine.sh runs abuild
in a pinned Alpine 3.24 container and tools/package-openwrt.sh runs the
pinned OpenWrt 25.12 SDK. Each run generates its own signing key and the
release attaches the public half; OpenWrt signs only its index, which is
attached as doona-openwrt.adb.

The nfpm packaging moves out of the build job and runs next to the two
apk jobs; it also builds doona-precompressed. A sums job collects every
package and writes SHA256SUMS, so the release job still only uploads.

workflow_dispatch packages package.json's version from a branch and keeps
the files as run artifacts, skipping the Check wait and the release.
@Zakkaus
Zakkaus force-pushed the feat/package-precompress branch from 934e770 to 020740b Compare October 4, 2026 08:01
@Zakkaus Zakkaus changed the title build(package): ship brotli and gzip siblings for text assets build(package): ship precompressed assets as an optional package, add apk packages Oct 4, 2026
The OpenWrt Makefile pins doona-precompressed to the same doona with
EXTRA_DEPENDS, as utils/vim does for vim-runtime, derives PKG_VERSION
from PKG_REAL_VERSION and downloads every archive unconditionally, as
net/v2raya does. The APKBUILD derives the tag from pkgver, names its
split functions with a leading underscore and moves the fonts with
amove, per the aports coding style.

Neither repository has a placeholder hash, so the packaging scripts
fill the hashes with `make package/doona/check FIXUP=1` and `abuild
checksum`, and the release run keeps the filled recipes as artifacts
under the default retention.
@Zakkaus
Zakkaus merged commit b66f1ec into main Oct 4, 2026
23 checks passed
@Zakkaus
Zakkaus deleted the feat/package-precompress branch October 4, 2026 09:01
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.

1 participant