ci: build release binaries once and stop recompiling archied #1852

Merged
sam merged 5 commits from ci/release-build-once into main 2026-11-10 11:42:32 +00:00
Owner

Run 2282 compiled the Go tree in four jobs and built the dashboard four times (twice inside the gate alone). This makes a release compile its binaries once, in the gate, and removes the archied build from the canary's fifteen-minute schedule.

What changes

Taskfile

  • task dist builds what release.json names into dist/. It uses the compiler flags build uses, so after the gate has built bin/ it only links.
  • build is static (CGO_ENABLED=0), like what ships. Release binaries gain -trimpath.
  • ui is run: once. check built the dashboard, then build's dependency built it again while the Go steps were embedding ui/dist.

Actions (.github/workflows)

  • deploy: a release gate runs task check dist and uploads dist/. dist-zip downloads it and no longer installs Go, Node or pnpm.
  • deploy: plan resolves the commit and version once; the image jobs read them. agent-image is skipped outside a release. dist-zip now needs archied-image.
  • deploy: both image jobs use one named builder that is never removed, so the Dockerfiles' new cache mounts persist.
  • canary, promote: copy archied out of archied:edge instead of compiling it.
  • Gate on Node 24 (was 22), govulncheck pinned to v1.9.0, release notes carry the prerelease flag.

Woodpecker (.woodpecker)

  • The same build-once and fetch-archied changes.
  • The gate and the pull-request check keep Go's module, build and lint caches in /var/cache/woodpecker-archie and /var/cache/woodpecker-archie-pr.
  • notes waits for publish. The canary clones with tags. release puts HEAD on main before task release.

Verified

  • With Go 1.27.3: after a build with the bin/ flags, a build with the dist flags recompiles 0 packages (2s). With the old dist-zip flags it recompiled 901.
  • task -n check dist runs pnpm run build once; on main it runs twice.
  • All ten pipeline files parse; actionlint is clean on the three changed workflows.

Not verified

No pipeline has run with these changes, and task check was not run. The first release exercises:

  • actions/download-artifact@v4 against this Gitea (upload v4 already works here).
  • The persistent archie-ci builder (cleanup: false). It stays running on the runner between jobs.
  • The Woodpecker files, which have not run in production in either form. canary, promote and quality now mount host paths, so they need the repo's trusted volumes setting like deploy does.

Behaviour changes

  • The canary judge is the archied from the newest main that passed the gate, not a build of main's HEAD.
  • release canary check still gets its checkout: a rollback diffs the migrations between two release tags.

Not included

  • Skipping the tag run's gate when the parent commit already passed.
  • Removing either CI system. With both enabled, every release is built and published twice.

A branch named ci/build-once with an overlapping change already existed when this was pushed; this PR does not touch it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SSgGJ5xH1eDady5kVjcc8x

Run 2282 compiled the Go tree in four jobs and built the dashboard four times (twice inside the gate alone). This makes a release compile its binaries once, in the gate, and removes the `archied` build from the canary's fifteen-minute schedule. ## What changes **Taskfile** - `task dist` builds what `release.json` names into `dist/`. It uses the compiler flags `build` uses, so after the gate has built `bin/` it only links. - `build` is static (`CGO_ENABLED=0`), like what ships. Release binaries gain `-trimpath`. - `ui` is `run: once`. `check` built the dashboard, then `build`'s dependency built it again while the Go steps were embedding `ui/dist`. **Actions (`.github/workflows`)** - `deploy`: a release gate runs `task check dist` and uploads `dist/`. `dist-zip` downloads it and no longer installs Go, Node or pnpm. - `deploy`: `plan` resolves the commit and version once; the image jobs read them. `agent-image` is skipped outside a release. `dist-zip` now needs `archied-image`. - `deploy`: both image jobs use one named builder that is never removed, so the Dockerfiles' new cache mounts persist. - `canary`, `promote`: copy `archied` out of `archied:edge` instead of compiling it. - Gate on Node 24 (was 22), `govulncheck` pinned to v1.9.0, release notes carry the prerelease flag. **Woodpecker (`.woodpecker`)** - The same build-once and fetch-archied changes. - The gate and the pull-request check keep Go's module, build and lint caches in `/var/cache/woodpecker-archie` and `/var/cache/woodpecker-archie-pr`. - `notes` waits for `publish`. The canary clones with tags. `release` puts HEAD on `main` before `task release`. ## Verified - With Go 1.27.3: after a build with the `bin/` flags, a build with the `dist` flags recompiles 0 packages (2s). With the old `dist-zip` flags it recompiled 901. - `task -n check dist` runs `pnpm run build` once; on main it runs twice. - All ten pipeline files parse; `actionlint` is clean on the three changed workflows. ## Not verified No pipeline has run with these changes, and `task check` was not run. The first release exercises: - `actions/download-artifact@v4` against this Gitea (upload v4 already works here). - The persistent `archie-ci` builder (`cleanup: false`). It stays running on the runner between jobs. - The Woodpecker files, which have not run in production in either form. `canary`, `promote` and `quality` now mount host paths, so they need the repo's trusted volumes setting like `deploy` does. ## Behaviour changes - The canary judge is the `archied` from the newest main that passed the gate, not a build of main's HEAD. - `release canary check` still gets its checkout: a rollback diffs the migrations between two release tags. ## Not included - Skipping the tag run's gate when the parent commit already passed. - Removing either CI system. With both enabled, every release is built and published twice. A branch named `ci/build-once` with an overlapping change already existed when this was pushed; this PR does not touch it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01SSgGJ5xH1eDady5kVjcc8x
sam added 4 commits 2026-11-10 11:40:34 +00:00
`task dist` builds the binaries release.json names into dist/ with the
compiler flags `build` uses, so after the gate has built bin/ it only links.
`build` is now static (CGO_ENABLED=0), like what ships.

`ui` runs once per task invocation: check built the dashboard, then build's
dependency built it again under the Go steps that embed it.

Both Dockerfiles compile with cache mounts for Go's module and build caches.
A release gate runs `task check dist`, uploads dist/, and dist-zip packages
that instead of installing Go and Node and compiling the tree again.

plan resolves the commit and version once for the image jobs. agent-image is
skipped outside a release. dist-zip waits for archied-image. The image jobs
share one builder that is never removed, so the Dockerfiles' cache mounts
survive between runs.

Also: Node 24 in the gate like everywhere else, govulncheck pinned, and the
release notes carry the prerelease flag.
canary and promote compiled archied from source on every run, the canary
every fifteen minutes. Both now copy the binary out of archied:edge, which
deploy already published for main.

The canary keeps its checkout: a rollback diffs the migrations between two
release tags. Promotion never reads the repository, so it drops its own.
ci(woodpecker): build once, keep Go's caches, fetch archied for the canary
Quality / check (pull_request) Canceled after 0s
ci/woodpecker/pr/quality Pipeline was canceled
73860b26d2
The same changes as the Actions workflows: a release gate runs
`task check dist` and the dist step only packages; canary and promote copy
archied out of archied:edge instead of compiling it.

The gate and the pull-request check keep Go's module, build and lint caches
on the host, in separate directories so a pull request cannot write into the
cache a release build reads.

Fixes: notes wait for the signed release and carry the prerelease flag;
the canary clones with tags, which its rollback needs to diff migrations;
release puts HEAD on main before `task release`, which refuses anything else.
sam force-pushed ci/release-build-once from 8f88b5b742 to 73860b26d2 2026-11-10 11:40:34 +00:00 Compare
sam added 1 commit 2026-11-10 11:41:17 +00:00
Merge branch 'main' into ci/release-build-once
ci/woodpecker/pr/quality Pipeline was successful
Quality / check (pull_request) Successful in 12m5s
c9a8e21759
sam merged commit 12a25faf31 into main 2026-11-10 11:42:32 +00:00
sam deleted branch ci/release-build-once 2026-11-10 11:42:32 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1852