Skip to content

ci: add installer ISO build + release workflows#34

Open
phorcys420 wants to merge 16 commits into
mainfrom
ci/installer-iso-workflows
Open

ci: add installer ISO build + release workflows#34
phorcys420 wants to merge 16 commits into
mainfrom
ci/installer-iso-workflows

Conversation

@phorcys420

Copy link
Copy Markdown
Member

What

Adds two GitHub Actions workflows for the installer ISO.

build.yml — verification CI

  • Triggers on push to main, all PRs, and manual dispatch.
  • Matrix builds make installer/iso/<arch> for both supported arches on native runners (ubuntu-24.04 for x86_64-linux, ubuntu-24.04-arm for aarch64-linux) — avoids slow QEMU emulation for full ISO builds.
  • Installs Nix (flakes + nix-command, needed by the Makefile's nix build --impure), caches the store, then resolves and uploads each coder-box-installer-<arch>.iso as a 7-day artifact.
  • concurrency cancels superseded runs; fail-fast: false so one arch failing doesn't kill the other.

release.yml — release trigger

  • Triggers on pushing a v* tag, or manual dispatch with a tag input (and optional prerelease flag).
  • Same per-arch build matrix, then a release job downloads both ISOs + .sha256 checksums and publishes them as assets on a GitHub Release (auto-generated notes, contents: write).

Notes

  • Arch list (x86_64-linux, aarch64-linux) and the ISO output path (out/installer-iso-<arch>/iso/coder-box-installer-<arch>.iso) derived from flake.nix, the Makefile, and nixos/_images/installer/iso.nix.
  • ubuntu-24.04-arm runners are free for public repos; private repos consume ARM runner minutes or need a self-hosted ARM runner.
  • Uses Determinate Systems Nix installer + magic-nix-cache; easy to swap for Cachix / self-hosted cache.

Validation

  • Both workflow files pass YAML parsing locally. (Workflows themselves run on this PR.)

@phorcys420 phorcys420 marked this pull request as draft June 21, 2026 18:28
@phorcys420 phorcys420 marked this pull request as ready for review June 21, 2026 18:28
Add two GitHub Actions workflows:

- build.yml: builds make installer/iso for x86_64-linux and
  aarch64-linux on native runners (push/PR/manual), uploading each
  ISO as a short-lived artifact.
- release.yml: same per-arch build matrix, triggered by a v* tag or
  manual dispatch, then publishes both ISOs (plus sha256 checksums)
  as assets on a GitHub Release.
- Build each arch natively (bare `make installer/iso` resolves to the
  runner's currentSystem) inside the nixos/nix container.
- Bring in gnumake + git through nix-shell.
- Correct ISO path to out/installer-iso/iso/coder-box-installer-<arch>-linux.iso.
The nixos/nix image has no standard glibc loader, so GitHub's bundled
Node fails (exec /__e/node24/bin/node: no such file or directory) when
the whole job uses container:. Instead run checkout/upload on the host
runner and execute only `make installer/iso` inside the nixos/nix
container via docker run, copying the ISO out of the ephemeral
container store into the mounted workspace before upload.
- Build both installer/iso and appliance/iso per arch (matrix target).
- Bump checkout/upload/download actions to v5 (Node 24; clears the
  Node 20 deprecation warning).
- Rename workflows: 'Build ISO' and 'Build and release ISO'.
- PR builds only on ready-for-review (opened/reopened/ready_for_review,
  no synchronize) + draft guard; still manually dispatchable for an
  arbitrary ref/commit.
- Upload ISOs from a host mktemp dir bind-mounted into the container
  instead of a tracked dist/ folder.
- build.yml artifact retention dropped to 1 day.
…ommit/PR

Runs on every push and pull_request (cheap, unlike the gated full image
builds). Evaluates the flake and instantiates the installer ISO
derivation for both arches via 'nix eval ... .drvPath' (writes the .drv,
no realisation), catching Nix typos/type errors in seconds without
building the multi-GB ISO. Both arches instantiate on one x86_64 runner
since evaluation needs no native builder; eval runs in the nixos/nix
container via docker run, checkout stays on the host.
Bare pull_request already defaults to opened/synchronize/reopened;
list the types explicitly so per-commit re-eval intent is clear.
Add a box_instantiate helper (box_build's sibling) that evaluates the
image derivation's .drvPath — fully evaluating the Nix and writing the
.drv to the store without realising the multi-GB image. Expose it as
installer/drv and appliance/drv (bare + arch-suffixed).

Eval Nix workflow now just calls these make targets for both arches
instead of an inline nix eval expression.
box_build and box_instantiate duplicated the entire
'let f = builtins.getFlake ... config.system.build' expression. Extract
it into a box_cfg $(call) function so the two can't drift; box_build
appends the build attr, box_instantiate appends .drvPath. Verified the
expanded recipes are byte-identical to before via make --dry-run.
Eval Nix now does two no-build checks: nix flake check
--no-build --all-systems (evaluates every flake output for all declared
systems) followed by the */drv ISO derivation instantiation. Reworded a
comment to drop an apostrophe that would break the single-quoted
docker-run shell block.
Replace the explicit two-arg 'cp /out/coder-box-<kind>-<arch>.iso' with
a /dist volume (host mktemp dir) bind-mounted into the container; the
build dereferences its store symlink into /dist via 'cp -L $outlink/*.iso
/dist/'. This drops the hardcoded filename (and the now-unused kind/SYSTEM
shell vars + env), and uploads from /dist. Release computes per-file
sha256 over /dist/*.iso.
Add a box_iso helper that runs box_build then writes out/<name>.iso.sha256
(bare basename, so 'sha256sum -c' verifies against the ISO beside it).
installer/iso and appliance/iso now use it. Both workflows drop their
inline sha256sum and just copy the make-produced sidecar from out/ into
the /dist volume.
- Rename Build ISO matrix jobs to 'Installer (<arch>)' / 'Appliance
  (<arch>)' (check shows as 'Build ISO / Installer (...)'); same for the
  release build jobs. Restructured the matrix to explicit include entries
  carrying kind/target/label.
- On PRs the full ISO for a kind builds only when its label is applied
  (test-installer-iso / test-appliance-iso); otherwise the job just
  instantiates the .drv (no image, no artifact). Added the 'labeled' PR
  trigger so applying a label starts the build. push/main and manual
  dispatch still always build the full ISO.
- Use bare make <kind>/iso (native arch per runner) so the out-link path
  stays out/<kind>-iso/iso.
Replace the runtime 'plan' shell step + single combined build with a
job-level FULL env (label check) and two if:-gated steps: 'Build full
ISO' (if env.FULL == true) and 'Instantiate ISO derivation' (if
env.FULL != true). Upload also keys off env.FULL.
@phorcys420 phorcys420 force-pushed the ci/installer-iso-workflows branch from ada2539 to f007c36 Compare June 22, 2026 15:26
@phorcys420 phorcys420 marked this pull request as draft June 22, 2026 15:27
@phorcys420 phorcys420 marked this pull request as ready for review June 22, 2026 15:27
- Drop '(in nixos/nix container)' from step names.
- In Build ISO, run the drv instantiation step before the full ISO
  build step.
- Upload the ISO and its .sha256 as two separate artifacts (was a
  single *.iso* artifact that zipped both together) in both workflows.
Restructure Build ISO from a kind×arch matrix into one job per arch that
builds BOTH kinds in the SAME container (installer first, appliance
later). Each kind is full-built or drv-instantiated independently based
on its label. The job title reflects which kinds get a full build:
'Installer + Appliance', 'Installer', 'Appliance', or 'Derivations'.
Per-kind ISO + sha256 artifacts uploaded only for full-built kinds.
New commits on a labelled PR were only producing derivations: Build ISO
omitted 'synchronize', so pushes never re-triggered it (only eval.yml,
which builds drv only, ran). Add synchronize so each commit re-runs the
build and re-evaluates labels, rebuilding the full ISO for labelled
kinds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant