Skip to content

ci: build the Docker image on PRs, push releases by digest, share the tarball script - #575

Merged
LeMyst merged 1 commit into
cooklang:mainfrom
LeMyst:ci/workflow-chores
Sep 28, 2026
Merged

LeMyst merged 1 commit into
cooklang:mainfrom
LeMyst:ci/workflow-chores

Conversation

@LeMyst

@LeMyst LeMyst commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Closes #574.

Stacked on #573, then #571 and #569. Only e86d7e2 is new here. Merge the four in order.

What changes

docker.yml (new). Runs on pull requests that touch Dockerfile, .dockerignore, docker-entrypoint.sh, the Cargo manifests or lockfile, or package*.json.

  • Builds the image for linux/amd64 with CARGO_PROFILE=docker-dev: the same Dockerfile, but thin LTO.
  • Reads the layer cache the release writes; it never writes to it.
  • Runs cook --version, starts the server, and waits for / to answer.

Release images pushed by digest.

  • docker_publish pushes each platform image with push-by-digest=true and hands the digest to docker_merge as a short-lived artifact. The artifact is named docker-digest-*, so the release's cook-* pattern does not attach it.
  • docker_merge builds :<version> and :latest from those digests, then inspects the result.
  • The unused "Extract version" step in docker_publish is removed.
  • The existing build-0/build-1 tags in GHCR need deleting by hand once; nothing recreates them.

One source tarball script.

  • packaging/source-tarball.sh <dir> makes cook-<version>-source.tar.gz (git archive plus the two web assets) and checks the assets are in it.
  • The release's source_tarball job calls it, and stops if the tag and Cargo.toml disagree on the version.
  • build-rpm.sh calls it when not given a tarball, and rpm.yaml now relies on that. So the RPM check exercises the release path, and it runs on any packaging/** change.

Stale references.

  • develop removed from the test.yml triggers.
  • CLAUDE.md now describes the UI Tests job instead of the non-existent ui-tests.yml, and says how to run actionlint/zizmor locally.
  • claude.yml template comments trimmed.

Not done: Dependabot for Docker. The base images use floating tags (node:lts-bookworm-slim, rust:bookworm, debian:bookworm-slim), which Dependabot's docker updater leaves alone. It would only act on version or digest pins. Pinning them is a reproducibility-versus-freshness decision for another PR.

Testing

  • actionlint 1.7.12 and zizmor 1.30.1: nothing to report.
  • packaging/source-tarball.sh: I compared its output with the v0.37.0 release asset. The prefix and layout are the same, both web assets are in, and there is no node_modules/ or target/; the listing differs only in files changed since v0.37.0. shellcheck is clean on it and on build-rpm.sh.
  • I built the image locally with CARGO_PROFILE=docker-dev and ran the smoke-test commands. Output: cookcli 0.37.0 - in food we trust, server answers.
  • This PR's own RPM and Docker checks run the RPM build and the image build end to end.
  • The digest push and merge only run on a release. They follow Docker's documented multi-platform pattern.

🤖 Generated with Claude Code

… tarball script

- New docker.yml builds the image (docker-dev profile, reading the
  release's layer cache) for pull requests that touch the Dockerfile,
  lockfiles or manifests, then checks `cook --version` and that the
  server answers. Until now only a release built it.
- The release pushes each platform image by digest and assembles the
  manifest from those, instead of the public `build-0`/`build-1` tags it
  left behind in GHCR.
- packaging/source-tarball.sh is now the one definition of the release
  source drop (git archive + web assets + the check that they made it
  in). The release job and build-rpm.sh call it, and rpm.yaml lets
  build-rpm.sh make its own, so the RPM workflow tests the release path.
- Stale references: the `develop` trigger in test.yml, the missing
  ui-tests.yml in CLAUDE.md (which now says how to run the workflow
  linters locally), and the action's template comments in claude.yml.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@LeMyst
LeMyst merged commit daa26e4 into cooklang:main Sep 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: Docker image untested before release, leftover GHCR tags, source tarball logic duplicated

1 participant