Releases and CI
Status: built (2026-10-15); reworked 2026-10-23 so packages are built once per commit and a release publishes them as soon as its commit is green.
1. Goals
- One command cuts a release:
make release BUMP=minorpushes a release commit. CI does the rest: tests, every package, smoke tests, then the tag, the GitHub release and the Homebrew tap. - Built once, published in minutes. Every push to
mainbuilds its packages while its tests run. A release commit is tagged and published from those same packages as soon as all of it is green, with no second test run and no rebuild. - CI runs what you run. Each workflow step is a make target or a script under
packaging/, so any CI failure can be reproduced with the same command on your machine. - Every change is tested on Linux and macOS, on every push to
mainand every pull request. - Nothing half-done. A release that fails before its tag leaves nothing behind. One that fails in CI publishes nothing, and the fix is a new patch release.
Not goals (for now): an apt repository (so apt upgrade would find new versions), signed packages, Docker images on a registry, Windows.
2. Workflows
| Workflow | Runs on | Does |
|---|---|---|
CI (.github/workflows/ci.yml) | every push to main; or by hand, as a dry run | the tests, the packages, and for a release commit the tag and the publication (§4) |
Test (.github/workflows/test.yml) | pull requests, and from CI | make check, then cargo test --locked on Ubuntu 24.04 and macOS 15, and the suite again with every core busy (docs/testing.md) |
Toolchain: the Rust version is set in one place, rust-toolchain.toml: rustup uses it for local builds, CI installs it through .github/actions/rust, and the Makefile passes it to the Docker builds (RUST_VERSION). Trunk's version comes from docker/Dockerfile (TRUNK_VERSION). So local, CI and Docker builds match.
UI transfer size: Trunk's post_build hook runs scripts/precompress-ui.sh
against TRUNK_STAGING_DIR before publishing dist. It writes Brotli quality-11
.br sidecars for WASM, JS, CSS and HTML, leaving originals intact. Thus direct
trunk build / trunk serve, make ui, make build, native deb/brew packaging
(both depend on build), and both Docker build stages share the same step.
CI's Trunk setup and both Docker toolchains install the Brotli CLI; local builds
need it too. A missing compressor fails the build rather than shipping an
uncompressed release. sh scripts/precompress-ui.sh [dist-directory] can also be
used by size checks; an absent dist directory is a no-op. Test with
sh scripts/test-precompress-ui.sh.
The head embeds originals and sidecars. It negotiates Accept-Encoding qvalues,
explicit exclusions, wildcards and identity, serves Brotli only when acceptable,
and sends Vary: Accept-Encoding even for the original representation. MIME and
fingerprinted immutable caching are based on the original path. API JSON uses
tower-http's streaming Brotli/gzip compression; event streams, WebSockets and UI
assets are not dynamically compressed. Native executable settings are unchanged.
Repeat visits and terminal assets: embedded assets include an ETag from
rust-embed's SHA-256 metadata (no runtime body hashing). Non-fingerprinted assets
remain no-cache, so the browser revalidates them; matching If-None-Match
returns an empty 304 with ETag, cache policy and Vary intact. Weak tags, lists,
wildcards, HEAD and distinct Brotli/identity representation tags are supported.
Fingerprinted assets retain their year-long immutable cache policy.
The HTML's helper scripts are deferred. xterm JS, fit addon and CSS are fetched
only when a terminal view opens, once per successful asset per page. Concurrent
opens share loading; failed assets can be retried by closing/reopening. Until
loading succeeds, the Rust view does not create xterm or attach the PTY socket.
Closing a view aborts its pending attachment, and disposes the active observer
and terminal before dropping callbacks. Loading failures display a UI error
instead of trapping. Test the loader with
node --test scripts/test-terminal-assets.cjs, and HTTP behavior with
cargo test -p c6-head assets::tests.
3. Versions
-
Semver.
make release BUMP=patch|minor|major(defaultpatch), orVERSION=x.y.z. The first release is0.2.0(make release BUMP=minor):0.1.0has been the unreleased development version. -
One version for the workspace. Every crate has
version.workspace = true, so a release sets[workspace.package] versionalone.c6_core::VERSION, which workers send to the head and which database upgrades record, is that version. -
Tags: annotated,
v0.2.0, made by CI on the release commit once it is green (never by hand). -
Package versions:
- for a release commit:
0.2.0(deb and brew alike); - between releases:
0.2.0+git<commit time>.<commit>(deb) and0.2.0.<commit time>(brew).
Both sort after
0.2.0and before0.2.1, so upgrades go the right way. The Makefile picks the plain version whenHEADcarriesv<crate version>, or whenRELEASE=1(CI building a release commit before tagging it). - for a release commit:
4. Cutting a release
make release [BUMP=… | VERSION=…] runs packaging/release/release.sh on your machine:
-
Checks:
- on
main, with a clean tree, atorigin/main; - the version is newer than the current one;
- its tag doesn't exist.
- on
-
The release commit:
- sets the version, and refreshes
Cargo.lockoffline; - puts a new section at the top of
CHANGELOG.md(§5); - commits
Release 0.2.0.
A failure along the way puts everything back.
- sets the version, and refreshes
-
Push: asks first (
YES=1skips the question), thengit push origin main. Not pushed, the commit stays local;git reset --hard HEAD~1undoes it.
Pushing it is the release. CI runs for it as for any push to main:
| Job | Runner | Does |
|---|---|---|
| meta | ubuntu-24.04 | the version, whether this is a release commit (Release <version>, not tagged yet), and whether its code was already tested (below) |
| test | Test workflow | Linux and macOS suites, and Linux under load (skipped for a release commit whose code was already tested) |
| linux | ubuntu-22.04, ubuntu-22.04-arm | make deb-test: the .debs and carbon6-<v>-linux-<arch>.tar.gz, built on Ubuntu 22.04 itself (its glibc is the minimum) with the cargo cache, then installed under systemd in a container, run, upgraded and removed |
| macos | macos-15 (Apple Silicon) | make brew-test: bottles and binary tarballs, with the cargo cache, then installed from a scratch tap, the head started with brew services, a worker attached, stopped with SIGTERM |
| publish | ubuntu-24.04, only for a release commit, after all the others | tags v<version> on that commit, then packaging/release/publish.sh (§6) on the packages the other jobs built |
| edge | ubuntu-24.04, for any other green push to main | packaging/release/edge.sh: the rolling edge pre-release, replaced with this commit's packages and a signed release.json, for machines on the edge channel (docs/updates.md §3a) |
The packages are built in parallel with the tests, so a release is published about when its tests finish. Intel Macs are not built (since 0.3.10).
No second test run for a release. A release commit normally changes only the version (in Cargo.toml and Cargo.lock) and CHANGELOG.md. When that's all it changes, and CI already passed on the commit before it (the same code), meta says so and the tests are skipped. The packages are still built, since the version is compiled into them. Anything else in the diff, or no green run on the commit before (a release cut before the previous push finished CI), and the tests run as for any commit.
Dry run: started by hand (Actions → CI → Run workflow, or gh workflow run ci.yml), it tests and builds main and keeps the packages on the run. publish is skipped.
5. Changelog
CHANGELOG.md, newest first. Each release adds a section:## 0.2.0 (2026-10-15), then one bullet per commit since the previous tag, its one-line message as written.- Release commits are left out of the list.
- The first release lists every commit since the start of the repository.
- The same section is the GitHub release's notes.
- Preview:
make release-notesprints the next section without changing anything.
6. Publishing
publish.sh <version> <dir> runs in CI's publish job, on the packages the other jobs built:
- The formulas, written by
packaging/brew/formulas.sh:- one per binary, for Apple Silicon (
depends_on arch: :arm64); - with a bottle for each;
- downloading from
https://github.com/carbon6-dev/carbon6/releases/download/v<version>/.
- one per binary, for Apple Silicon (
SHA256SUMSof every file, and the notes: the version's section ofCHANGELOG.md. Alsorelease.json, signed intorelease.json.sigwith the secretRELEASE_SIGNING_KEY(manifest.sh). Without the secret it is unsigned, and machines don't update themselves to that release.- The GitHub release
v<version>, with the files below. If the release already exists (a re-run), missing files are uploaded. - The tap: the formulas are committed to
carbon6-dev/homebrew-carbon6, sobrew install carbon6-dev/carbon6/c6hworks andbrew upgradefinds new releases.- This needs the repository secret
TAP_TOKEN: a fine-grained token with Contents: read and write on the tap repository only. - Without the secret, the formulas are only attached to the release, and the run says so.
- This needs the repository secret
The files on a release:
| File | What it is |
|---|---|
c6h_<v>_amd64.deb, _arm64.deb (and c6w, c6; c6m until 0.2.2, since the memex is part of the head) | Ubuntu packages with systemd units, for 22.04 and later |
carbon6-<v>-linux-amd64.tar.gz, -arm64 | the four binaries, for Linux without packages |
c6h-<v>.arm64_big_sur.bottle.tar.gz (and the others) | Homebrew bottles for Apple Silicon, macOS 11 and later |
c6h-<v>-darwin-arm64.tar.gz (and the others) | each binary for macOS without Homebrew; also the formulas' source |
c6h.rb and the other formulas | the formulas, as pushed to the tap |
SHA256SUMS | checksums of all of the above |
release.json, release.json.sig | the manifest carbon6 updates itself from, and its Ed25519 signature (docs/updates.md §2) |
7. Make targets
| Target | Does |
|---|---|
make release [BUMP=… | VERSION=…] | §4: checks, release commit, push (CI tags and publishes) |
make release-notes | prints the next changelog section |
make docker-deb-test [ARCH=…] | the Linux job: builds and tries the .debs under systemd |
make brew-test | the macOS job: builds and tries the bottles. It installs into this Mac's Homebrew, so it refuses where c6h etc. are installed or :7700 is in use, and removes all it installed |
make brew-dist | bottles and formulas (with file:// URLs) into dist/brew/, without a tap |
8. Setting it up (once)
- Dry run: run CI by hand on
main(§4) and check that every job passes. - Tap repository: create a public, empty
carbon6-dev/homebrew-carbon6. - Token: make a fine-grained token for it with Contents: read and write, and add it to
carbon6-dev/carbon6as the Actions secretTAP_TOKEN. - Release:
make release BUMP=minorcuts0.2.0. - Signing key for self-updates:
gh secret set RELEASE_SIGNING_KEY < ~/.config/carbon6-release/signing-key.pem. Its public half isc6_core::update::RELEASE_KEYS.
9. Open questions
- Upgrade check across releases. A release could keep a small
c6h.dbandmemex.db(packaging/release/fixtures/<version>/), and CI could runc6h upgrade --checkfrom the previous release's copies (and of its knowledge store). That catches a migration that breaks upgrades before it ships. - The commit in
--versionbetween releases. Today a build after0.2.0reports0.2.0. A build script could add+git<commit>. - An apt repository. A signed one, on GitHub Pages, would let
apt upgradepick up releases. It needs a signing key in the repository's secrets. - Docker images.
carbon6/c6handcarbon6/c6wcould be pushed toghcr.ioby CI's publish job.