diff --git a/README.md b/README.md index aec1359..a9046d5 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,9 @@ Acquire::https::updates.rakuensoftware.com::SslKey ""; `conf/sources` lists the projects. Every hour `smoothapt-ingest`: 1. lists each project's GitHub releases, prereleases included, so every - build the pipeline publishes from `main` reaches the archive unattended; + build the pipeline publishes from `main` reaches the archive unattended. + A project marked `stable` (SmoothNAS) takes only full releases; its + prereleases are skipped without being downloaded; 2. downloads every `.deb` of a release it has not seen (debug-symbol packages excepted); 3. verifies it. For a public project (`attestation`), its attestation is diff --git a/bin/smoothapt-ingest b/bin/smoothapt-ingest index b57f005..aaca605 100755 --- a/bin/smoothapt-ingest +++ b/bin/smoothapt-ingest @@ -111,11 +111,12 @@ def read_sources(): line = line.split("#", 1)[0].split() if not line: continue - if len(line) != 5 or line[4] not in ("attestation", "actions-upload"): - sys.exit(f"{SOURCES}:{n}: expected attestation|actions-upload") - repo, archive, suite, workflow, check = line + if (len(line) not in (5, 6) or line[4] not in ("attestation", "actions-upload") + or line[5:] not in ([], ["stable"])): + sys.exit(f"{SOURCES}:{n}: expected attestation|actions-upload [stable]") + repo, archive, suite, workflow, check = line[:5] sources.append(dict(repo=repo, archive=archive, suite=suite, - workflow=workflow, check=check)) + workflow=workflow, check=check, stable=line[5:] == ["stable"])) return sources @@ -267,12 +268,15 @@ def run(src): hint = "token in " + TOKEN_FILE + " has no access" if github_token() else "no token in " + TOKEN_FILE raise RuntimeError(f"repository not found or private ({hint})") from None raise - releases = sorted((r for r in releases if not r["draft"]), key=lambda r: r["published_at"] or "") + # A "stable" project serves only its full releases: its prereleases (e.g. + # SmoothNAS's testing builds) are never meant for the archive, so they are + # not downloaded, verified or reported as rejected. + releases = sorted((r for r in releases if not r["draft"] and not (src["stable"] and r["prerelease"])), + key=lambda r: r["published_at"] or "") # A project's first ingest starts from its newest release it can take: # the archive only ever serves the newest anyway, and older builds would # each be downloaded and verified only to be pruned. It walks back past - # releases that are refused (e.g. SmoothNAS's testing prereleases, signed - # by a run on the testing branch) until one is ingested. + # releases that are refused until one is ingested. if not state["ingested"]: releases = releases[::-1] for rel in releases: diff --git a/conf/sources b/conf/sources index f4752dd..00e31f8 100644 --- a/conf/sources +++ b/conf/sources @@ -1,6 +1,6 @@ # Projects smoothapt ingests, one per line: # -# +# [stable] # # archive reprepro archive under /var/lib/smoothapt/archives (served as # //): "public", or "smoothrouter" for the per-user one. @@ -13,9 +13,12 @@ # GitHub Actions, with the digest GitHub recorded. Needs the token in # /etc/smoothapt/github-token. # -# Every release the workflow publishes is ingested, prereleases included: -# a build from main reaches the archive with no manual step. +# stable optional: take only full releases and skip prereleases without +# downloading them (SmoothNAS's testing builds are prereleases). +# +# Otherwise every release the workflow publishes is ingested, prereleases +# included: a build from main reaches the archive with no manual step. RakuenSoftware/smoothkernel public common release.yml attestation RakuenSoftware/smoothrouter smoothrouter smoothrouter release.yml actions-upload RakuenSoftware/smoothfs public smoothnas release-please.yml attestation -RakuenSoftware/smoothnas public smoothnas release.yml attestation +RakuenSoftware/smoothnas public smoothnas release.yml attestation stable