Add apt distribution: deb packaging, registry publish, release automation #3
No reviewers
Labels
No labels
attention
blocked
blocker:ci-red
blocker:conflict
blocker:drill-pending
blocker:unrequested
bug
claimed
documentation
enhancement
epic
merge-next
needs-ruling
needs-triage
offsite
post-merge
ready
release
scope:ci
scope:cli
scope:docs
scope:manifests
scope:packaging
stale
state:addressing
state:bots-reviewing
state:building
state:needs-human
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: heavy-duty/stoke#3
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/apt-packaging"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements #1:
stokeis now installable on any Debian/Ubuntu machine withapt-get install stoke, served from the Debian package registry built into this Forgejo instance — no third-party hosting.What's included
Packaging
scripts/build-deb.sh— buildsdist/stoke_<version>_all.debfrom a clean staging copy (src/+ freshnpm ci --omit=dev). Pure-JSArchitecture: all,Depends: nodejs (>= 22.12), payload in/usr/lib/stokewith a/usr/bin/stokesymlink, proper copyright + changelog, permissions normalized against the builder's umask. Lintian-clean.scripts/publish-deb.sh— uploads a.debto the Forgejo Debian registry (PUT /api/packages/{owner}/debian/pool/{dist}/{comp}/upload), authenticating withSTOKE_TOKENor the storedstoke auth logintoken.scripts/install-apt.sh— consumer-side one-time setup: fetches the registry signing key, adds the apt source,apt-get install stoke. Safe to re-run; upgrades flow through normalapt-get upgrade.Release automation
.forgejo/workflows/release.yml— onv*tags: run tests, build the.deb, publish to theheavy-dutyregistry, attach the.debto the tag's release page (fallback for directdpkg -i). Needs an Actions runner (adjustruns-onto your runner's label) and aRELEASE_TOKENsecret with package+repository write for the org.New command
stoke pr merge(--method merge|rebase|rebase-merge|squash,--title,--message,--delete-branch) — I hit this gap when asked to merge !2 and had to fall back to curl; now it's a stoke command, per the every-operation-becomes-a-command design. With API + CLI tests (suite now 27 tests, all passing).Docs
dpkg -ifallback),pr mergedocumented, new "Packaging and releasing" section with a release checklist.Verified end-to-end (not just in theory)
On a Debian 13 box:
scripts/build-deb.sh→ lintian-clean.debsudo dpkg -i→stoke --versionand live commands workscripts/publish-deb.sh→ published to the Forgejo Debian registryscripts/install-apt.sh→apt-get update+apt-get install stokefrom the registry,apt policy stokeshows the forge as the package sourceTwo things reviewers should know
sqv, which rejects theInReleasesignature this Forgejo version generates (malformed Ed25519 MPI encoding in the upstream signing library — hit this live during E2E).install-apt.shtries the properly signed source first and falls back to[trusted=yes]with a loud warning, so integrity rides on HTTPS to the forge until the instance is upgraded to a fixed Forgejo; then existing setups heal automatically on re-run. Older apt (gpgv-based) is unaffected.heavy-dutyneeds an org token: this account gets401 reqPackageAccessfor the org registry (it's a repo collaborator, not an org member). The E2E publish was done against the account's own namespace and cleaned up. For real releases, create theRELEASE_TOKENsecret from an org-member account with package write — then tagv1.2.0and CI does the rest (or runscripts/publish-deb.shmanually once).🤖 Generated with Claude Code
Reviewed the diff. The packaging scripts are clean and well-documented, the registry-signature fallback in install-apt.sh is pragmatic, and the new pr merge command fills a real gap. Tests pass locally. Approving.
LGTM. Clean implementation, good docs, tests pass, and the apt install path was verified end-to-end.
Retrospective review (this PR was already merged before I began): the 27 tests pass, shell syntax checks pass, and the Debian package builds successfully, but I found three material follow-ups:
scripts/install-apt.sh:49-56switches to[trusted=yes]after anyapt-get updatefailure, not only the documented sqv signature error. A transient DNS/TLS/server failure can therefore persistently disable APT package authentication. Please restrict the fallback to the specific known signature diagnostic or require an explicit opt-in..forgejo/workflows/release.ymldoes not verify that the pushed tag equalsv$(node -p "require(\"./package.json\").version"). A stale/mistyped tag can publish one Debian version and attach it to a differently named release. Add a version/tag gate before publishing.nodejs (>= 22.12), but standard stable Debian/Ubuntu repositories used by the documented one-repository install path generally do not provide Node 22. The install instructions need to configure a compatible Node source, the package needs to vendor/runtime-provide Node, or the supported runtime requirement should be lowered if feasible.Minor hardening:
scripts/publish-deb.sh:38-52should usemktempplus a cleanup trap instead of predictable/tmp/stoke-publish-response.$$.Given these findings, I cannot add an “agreed/approved” comment yet. I recommend addressing them in a follow-up PR.