Skip to content

ci: upload already-compressed artifacts without zipping - #4796

Closed
helix-red wants to merge 2 commits into
masterfrom
ci/unarchived-artifacts
Closed

helix-red wants to merge 2 commits into
masterfrom
ci/unarchived-artifacts

Conversation

@helix-red

@helix-red helix-red commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Decision needed: rollout. Merging changes every StartOS image, product deb and package s9pk artifact name at once. Tooling that looks artifacts up by their old fixed names stops finding runs built before the merge. Those runs expire within 14 days. Until then:

  • make start-os-update-from-gha without RUN_ID uses only runs built after the merge. With an older RUN_ID it fails, and the image has to be fetched by hand with gh run download <run> -n <platform>.squashfs.
  • apt-publish-alpha cannot see the old-named debs. Each product keeps the alpha apt version it already has, with the existing "no complete master build left" warning, until that product next builds on master.
  • Ops: the migration payload is now the artifact startos-<version>-<hash>_<platform>.migration.squashfs. gh run download cannot fetch it. Download it from the run page or with scripts/gha-artifact-download.sh <repo> <run> 'startos-*_<platform>.migration.squashfs' <dir>.
  • manage-release.sh pull-gha needs no transition handling, provided it is always run from the commit being released (as agreed).

Is a transition without fallbacks to the old names acceptable, or should the lookups also try the old names for 14 days?

Summary

  • Already-compressed files are no longer zipped. These uploads use actions/upload-artifact@v7's archive: false:

    • startos-image.yaml: .squashfs, .iso, .img and .migration.squashfs.
    • build-products.yaml: the start-cli/start-registry/start-tunnel .debs.
    • Package CI's build.yml/release.yml: s9pks.

    Each artifact is the file itself, so downloads from the Actions page are the raw file rather than a .zip. The image uploads were already at compression-level: 0, so this removes only the zip wrapper. The .migration.squashfs and the debs were previously compressed at the default level.

  • Artifact names now follow the file name. With archive: false, GitHub names the artifact after the file and ignores name:, for example startos-0.4.0-abc1234_x86_64.squashfs instead of x86_64.squashfs. Every consumer now matches on that file-name pattern:

    • The workflow downloads (StartOS deploy and migration, the registry Docker image, package release Publish) use pattern: with merge-multiple: true.
    • The scripts and apt-publish-alpha use the two helpers described below.
  • StartOS deploy checks its images. A download by pattern does not fail when nothing matches, unlike the old download by name. The deploy leg now checks that its squashfs and its iso (or img for raspberrypi) are present before uploading anything.

  • Package releases:

    • BuildMatrix uploads each s9pk as its own unarchived artifact with 14-day retention, and Publish downloads all of the run's artifacts.
    • The second "upload each s9pk" pass at the end of Publish is removed. Its artifact names would now collide with BuildMatrix's.
    • As a result, a release whose Publish job fails keeps its s9pk artifacts for 14 days instead of 1. A successful release keeps the same 14-day per-s9pk artifacts as before.

Implementation diff: +111 / −87 lines in 16 files (excludes lockfiles, tests, docs, release notes, and changelog). One of those lines is the regenerated upload-each/dist/index.js bundle.

Approach

  • gh run download cannot fetch unarchived artifacts (Can't Download Non-Zipped Artifacts cli/cli#13012, open upstream). The new scripts/gha-artifact-download.sh lists a run's artifacts, matches them against a glob, and saves each one through the REST /artifacts/<id>/zip endpoint. For an unarchived artifact that endpoint serves the raw file. manage-release.sh pull-gha, update-from-gha.sh and apt-publish-alpha.yml use it. The un-zipped start-cli_<triple> binaries and compiled-*.tar keep using gh run download.
  • gha-artifact-run-ids.sh now takes a glob. The artifacts API filters only by exact name, and the repository holds about 11k artifacts. The script now pages through them newest-first and stops at the first expired match. This assumes that artifacts matching one glob share a retention period, which holds because each glob covers a single upload site. Without that early stop, a lookup with no match would page through the whole list.
  • upload-each gains an archive input, defaulting to true, which mirrors upload-artifact. It already uploaded one artifact per file named after the file, so it now covers package releases too, including variant targets that build several s9pks. A plain upload-artifact step with archive: false takes only one file.
  • Forgejo: its upload-artifact@v4 has no archive input. The Forgejo workflow generator drops the input and keeps compression-level: 0, so Forgejo still uploads a zip, uncompressed.
  • Registry image job: it reads the architecture from the deb file name at the first underscore, which keeps x86_64 whole. @helix-white caught that cutting at the last underscore broke x86_64, and proposed this fix and its test.
  • Extra scope: a stale comment about gh run download directories is removed from debian/publish.sh.

Testing (run on this branch through the repository's recipes on the Helix build host)

  • make release-notes-test: all 199 node tests pass. They cover:

    • glob discovery: newest first, other branches and platforms excluded, paging beyond the first page, and stopping at the first expired match;
    • the download helper: only unexpired matches, and failure when nothing matches;
    • image-run selection.

    apt-publish-test.sh in the same recipe stops because the host lacks apt-ftparchive. It exercises debian/publish.sh's indexing, which this PR changes only by deleting a comment.

  • make package-ci-test: 169 pass. This includes:

    • apt-publish-alpha's collection step run against a faked GitHub API using the new names;
    • the deploy-leg presence check for x86_64 and raspberrypi;
    • the registry image's architecture mapping for each architecture and for all three together;
    • the Forgejo variants, including compression-level: 0 and no archive.
  • upload-each: npm test passes, and the rebuilt dist matches its source.

  • Generator and formatting: generate-forgejo-workflows.cjs --check passes and Prettier is clean.

  • Not exercised end to end: the real upload and download against GitHub, the REST download of an unarchived artifact (the gh issue shows that endpoint returns the raw file), and a full image or package release. This PR's CI does not run the image or release workflows, so their first real run will be the first master image build or package release after merge.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

Images (squashfs, iso, img, migration squashfs), product debs and s9pks
are uploaded with archive: false, so each artifact is the file itself and
is named after it. Downloads match those file names by pattern, and the
release tooling fetches them through a REST helper because gh run download
cannot fetch unarchived artifacts (cli/cli#13012).

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Preserve the underscore in x86_64 when parsing deb filenames

In .github/workflows/build-products.yaml:315, ${filename##*_} strips through the last underscore. A downloaded start-registry-0.4.0-<hash>_x86_64.deb therefore produces arch=64, and the Docker-image job exits with Unknown architecture: 64. This blocks registry-image publication for the normal full matrix and x86-only builds.

Keep ${filename#*_}: the first underscore separates the build name from the complete architecture. The proposal restores it and adds regression coverage against the production workflow step for each architecture and the combined matrix.

Reviewed the upload/download consumers, release handoff, and Forgejo conversion. The reviewed head merges cleanly with origin/master. No builds or tests were run during review; the author must verify the proposed change.

Proposed changes: 6bd285b...proposal/4796

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
@helix-red

Copy link
Copy Markdown
Contributor Author

Adopted the proposal as is (cherry-picked onto the branch). ${filename#*_} is restored, so x86_64 keeps its underscore, and the new test runs the production Map matrix.arch to docker platform step for each architecture and for the full matrix. I checked for the same ##*_ pattern elsewhere in the change and there are no other occurrences. make package-ci-test: 169 pass.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The revision adopts the proposal exactly: the parser preserves x86_64, and regression coverage exercises each architecture and the combined matrix through the production workflow step. My previous finding is resolved; no further correctness issues found. The updated head merges cleanly with origin/master.

The author reports 169 passing package-CI tests. Current head CI is pending; no builds or tests were run during review.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red
helix-red requested a review from dr-bonez November 18, 2026 21:25
@helix-red
helix-red dismissed helix-white’s stale review November 18, 2026 21:29

Dismissed by Helix: the changes require a substantive PR brief update. Registry-image architecture parsing changes from rejecting x86_64 as 64 to correctly selecting linux/amd64, unblocking full-matrix and x86-only publication. The substantive explanation must reflect that repaired publication behavior; this is not merely added regression coverage.

helix-red added a commit that referenced this pull request Nov 18, 2026
Folds ci/unarchived-artifacts into this branch: both change how StartOS
build and image artifacts are handed between jobs.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
@helix-red

Copy link
Copy Markdown
Contributor Author

Closing in favor of #4795, which now includes this branch. It was merged into #4795 as 1e2f55b, since both PRs change how StartOS build and image artifacts move between jobs. #4795 also adds @dr-bonez's follow-up: the Pi image ships as an unzipped .img.gz that the deploy and pull-gha gunzip. The rollout question from this PR's description is carried over to #4795.

@helix-red helix-red closed this Nov 18, 2026
dr-bonez pushed a commit that referenced this pull request Nov 19, 2026
…tifacts unzipped, ship the Pi image gzipped (#4795)

* ci(start-os): build the container-runtime rootfs in the native image job

compiled-<arch>.tar carried rootfs.<arch>.squashfs, whose build runs apt in a
target-architecture chroot. The riscv64 build job runs on an x86 runner, so
that step ran under QEMU. The tarball now carries the container-runtime dist
instead, and startos-image.yaml, which already runs on a native runner for
every platform, assembles the rootfs. The rootfs scripts and units join
OS_IMAGE_PATHS so pull requests touching them still build images.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

* ci: upload already-compressed artifacts without zipping

Images (squashfs, iso, img, migration squashfs), product debs and s9pks
are uploaded with archive: false, so each artifact is the file itself and
is named after it. Downloads match those file names by pattern, and the
release tooling fetches them through a REST helper because gh run download
cannot fetch unarchived artifacts (cli/cli#13012).

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

* Proposed changes for #4796

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

* fix(start-os): extract the container-runtime base instead of loop-mounting it

The riscv64 image runner's kernel cannot mount squashfs, so building the
rootfs there failed at the base mount. update-image.sh now unpacks the base
with unsquashfs and builds in the extracted tree, which also drops the
overlay. update-image-local.sh stops when its container fails rather than
letting make continue without a rootfs.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

* ci(start-os): hand off compiled artifacts as an unzipped tar.gz

The build job's compiled-<arch>.tar exists only to keep the binaries'
execute bits, which a zipped artifact drops. It is now gzipped and uploaded
with archive: false, so the artifact is that file as-is rather than a zip
around a tar; the image job downloads it by its filename.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

* ci(start-os): ship the Pi image as an unzipped img.gz

The raspberrypi image job gzips its .img and uploads the .img.gz with
archive: false. The deploy leg and manage-release.sh pull-gha gunzip it for
the raw image the registry indexes and signs; pull-gha keeps CI's .gz, which
the release publishes beside the bare image.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

* Proposed changes for #4795

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

* fix(ci): bound artifact discovery by creation age, not expiry

Adopts @helix-white's proposal to skip expired matches rather than stop at
the first one, since expiry does not follow listing order. Both callers read
the whole output, so discovery instead stops at the first artifact created
over 15 days ago, past the 14-day retention of every artifact it searches.
The fixtures give rerun artifacts their own creation time.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

* ci(start-wrt): upload the flashable images unzipped

The image job uploads each StartWRT .img.gz as its own artifact with
archive: false, through the repo's upload-each action. The deploy downloads
them by pattern and checks that both the sdcard and the sysupgrade image are
present, and manage-release.sh pull-gha fetches them with
gha-artifact-download.sh, since gh run download cannot.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

* fix(ci): share one artifact discovery across the deb products

Adopts @helix-white's proposal: apt-publish-alpha makes one
gha-artifact-run-ids.sh call with an extended glob over its product list
rather than one per product, so each publication reads the artifact
listing once.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

* ci(start-os): build the container-runtime rootfs once per architecture

A rootfs job in build-products.yaml builds rootfs.<arch>.squashfs on a
native runner for each architecture and uploads it unzipped; the image jobs
and the publish run download it instead of each rebuilding it, so x86_64 and
aarch64 no longer build it three and four times.

The RISC-V action-runtime bootstrap and the compiled-tarball unpacking move
into local composite actions shared by the image and rootfs jobs. The
bootstrap now runs right after checkout, ahead of every other JavaScript
action, since checkout transfers no artifacts.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

* fix(ci): let the rootfs job download its compiled tarball

Adopts @helix-white's proposal: downloading an artifact by run id needs
actions: read, which the rootfs job's explicit permissions dropped. The
shared action records the requirement, and a test covers every
compiled-artifact consumer.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

* ci(start-os): publish the Pi image gzipped only

The deploy uploads the raspberrypi .img.gz and indexes it in the registry's
img slot through a hardlink named for the slot, like StartWRT's images; no
raw .img is uploaded. manage-release.sh signs and checksums the .img.gz, the
release notes link the indexed URL, and push-gz, ensure_img_gz and the .gz
handling in pull and pull-gha are gone.

start-cli's 'registry os asset get' now names a download .gz when its URLs
serve a .gz file, so gzipped images (StartOS's and StartWRT's) are no longer
saved as .img.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

* fix(release): keep legacy raw Pi images signed and checksummed

Adopts @helix-white's proposal: a version indexed with a raw .img before the
gzip-only switch still releases with that image in its checksums and
signatures, and only a .gz link carries the gzip tooltip. Adds the StartOS
and start-cli changelog fragments and drops the gzip-copy wording from the
prerelease docs.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

* revert(release): drop legacy raw Pi image handling

This merges before the next StartOS release is built, so no released
version carries a raw .img entry: release files and the gzip tooltip
cover the .img.gz only. Keeps the changelog fragments and the doc
wording from the previous commit.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

---------

Co-authored-by: helix-white <267227783+helix-a@users.noreply.github.com>
@MattDHill MattDHill added the repo Repository maintenance label Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci repo Repository maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants