Create repository APK repo #8
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
residual/.agent#8
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Plan: Create
repositoryrepo (residual APK package build scripts)Status: APPROVED — implementation pending. See the Handoff section below for concrete, ordered implementation steps.
Goal
Stand up a new, separate
repositorygit repo at the workspace root that holds APKBUILD package-build recipes only (no source code). It produces theres-coreandres-extraapk repositories, published to Forgejo's Alpine package registry and later consumed byosas additional repos. Stock Alpine stays untouched;osremains the image builder.Decisions locked (from planning discussion)
curl --user {owner}:{token} --upload-file pkg.apk https://{host}/api/packages/{owner}/alpine/{branch}/{repository}https://{host}/api/packages/{owner}/alpine/{branch}/{repository}to/etc/apk/repositories, fetch signing key fromhttps://{host}/api/packages/{owner}/alpine/keyinto/etc/apk/keys/, thenapk update.res-edit(editor/) andres-os(os/cmd/res-os) packaging are out of scope (separate effort)..aportsstays physically for reference; added to root.gitignore(never committed).repositoryis built fresh using aports patterns, not as a fork.Design
repository/is a fresh git repo. aports is reference only.res-core/←core/source;res-extra/←extra/source. Each package is one subdir containing anAPKBUILDstub.os/residual/(the placeholder package tree) moves intorepository/;osbecomes image-build only.CODINGSTYLE.md,COMMITSTYLE.md) move fromos/torepository/.lint.yml(advisory shellcheck + apkbuild-lint) andbuild.yml(build changed packages → publish to Forgejo). Rebuilt from aports' GitLab CI approach, not its GitLab syntax.discover_repos()(.agent/tools/common.sh), sorepositoryis auto-discovered — no edits to theREPOSarrays needed.build-all.sh/test-all.shfilter bygo.mod, sorepository(nogo.mod) is correctly skipped. Root.gitignoregains/repository/and/.aports/.AGENTS.md,docs/architecture.md,docs/os/os.md) updated for the new repo and the moved package tree.Out of scope
res-edit/res-ospackaging.osISO--repositorywiring (documented as future; not changed now).Verification
cd repository && git statusshowsres-core/,res-extra/,.forgejo/, READMEs, and style docs; nogo.mod.bash .agent/tools/status-all.shlistsrepository;sync-repos.shdiscovers it;.aportsandrepositoryare git-ignored at the root.osstill builds an ISO unchanged — no regression from movingos/residual/.AGENTS.md/docs/architecture.md/docs/os/os.mdare consistent;os/residual/is no longer described as the package tree.Handoff (ordered, concrete steps for the build agent)
Run from the workspace root
/workspace/git.merith.xyz/residualunless noted. Replaceforgejo.example.com/residual(owner) / branchv3.24with the real Forgejo values when known; confirm the Forgejo host + owner before authoringbuild.yml's publish step.Phase 0 — Pre-flight
repositoryremote:git.merith.xyz/residual/repository(adjust if the real remote differs).branchused for the registry (e.g.v3.24). These feedbuild.ymland the futureos--repositoryURL.FORGEJO_TOKEN(used bybuild.yml).Phase 1 — Initialize the repo
Phase 2 — Directory skeleton
Phase 3 — Move APKBUILD style docs out of
os/os/CODINGSTYLE.mdandos/COMMITSTYLE.mdare aports-derived APKBUILD/aports commit conventions — they belong in the package repo. Copy to./CODINGSTYLE.md/./COMMITSTYLE.md; inos/(separate commit):git rm CODINGSTYLE.md COMMITSTYLE.md, editos/README.mdto state os is image-build only.Phase 4 —
repository/README.md(see plan for full content)Documents APKBUILD-only recipes,
res-core/res-extrarepos, publishing to Forgejo Alpine registry, consuming via/etc/apk/repositories+ signing key.Phase 5 —
repository/.gitignorePhase 6 — APKBUILD stubs
One
APKBUILDper package (placeholders;source=/builddir=/pkgverfinalized when actually built). Template forres-core/res-console/APKBUILD:Create analogous files for:
res-core/res,res-core/res-init,res-core/res-sh,res-core/res-login, andres-extra/res-calc(pkgname/cmdpath adjusted;res-calcsource isextra/).Phase 7 — Forgejo workflows
.forgejo/workflows/lint.yml(advisory): alpine:3.24 container; shellcheck + apkbuild-lint (continue-on-error: true)..forgejo/workflows/build.yml(build + publish): on push to main with APKBUILD path changes;abuild -rchanged packages;curl --user "${FORGEJO_OWNER}:${FORGEJO_TOKEN}" --upload-filetohttps://${FORGEJO_HOST}/api/packages/${FORGEJO_OWNER}/alpine/${BRANCH}/${repo}. UsesFORGEJO_HOST/FORGEJO_OWNER/FORGEJO_TOKEN/BRANCHenv (TODO: real values).Phase 8 — Root
.gitignoreAdd to the "Each subdirectory is an independent git repository" block:
Phase 9 — Harness (no edits required)
.agent/tools/*.shalready usediscover_repos();repository/is discovered automatically.build-all.sh/test-all.shfilter bygo.mod, sorepository(nogo.mod) is correctly skipped.Phase 10 — Docs
AGENTS.md: addrepositoryto workspace-layout tree + separate-repos list; note it is a package-build repo producingres-core/res-extraapk repos; keeposas image builder.docs/architecture.md: addrepositoryto repo-layout table.docs/os/os.md: update stale "repository structure (planned)"; noteos/residual/moved torepository; ISO will later consumeres-core/res-extrafrom Forgejo (future wiring).Phase 11 — Commit & verify
Verify:
git statusclean; tree hasres-core/,res-extra/,.forgejo/, READMEs, style docs; nogo.mod. From root:bash .agent/tools/status-all.shlistsrepository;osstill builds an ISO unchanged; root.gitignoreignores/repository/and/.aports/.Future (not in this handoff)
os/entrypoint.shandos/.forgejo/workflows/build-iso.ymladd--repositoryURLs forres-core/res-extrafrom Forgejo.res-edit/res-ospackaging in separate efforts.