Kyle CarberryandClaude Opus 5.5 11f72a8ae9 ci: publish release images and charts through coder/ghcr-publisher (#32566)
GitHub grants package write access to a whole repository, not to a
workflow, branch or environment. Today `ghcr.io/coder/coder`,
`coder-base` and the OCI charts list coder/coder with Write, so any
workflow on any branch here can request `packages: write` and overwrite
a release tag with this repository's `GITHUB_TOKEN`. The `release`
environment and the tag rulesets don't stop that. GHCR accepts neither
App tokens nor OIDC, so the repository boundary is the only way to
separate who publishes.

With this change, releases push to `*-staging` packages and trigger
**coder/ghcr-publisher**, a locked repository that will be the only one
with Write on the public packages. Before copying a digest, it verifies
three things:
- this `release.yaml` attested it,
- on `release/X.Y` (or `main` for an RC), with the signer being
`release.yaml` at that same ref,
- built from the commit the `vX.Y.Z` tag points to.

It copies by digest and never moves an existing version tag. It moves
`latest` only to the highest stable version.

### Changes
- **release.yaml**
- Images, the base image and the OCI charts are pushed to
`coder-staging`, `coder-base-staging` and `chart-staging/*`.
- The charts get attestations for their OCI manifest digests. The
existing `.tgz` attestations don't cover those digests.
- The base and image attestations no longer `continue-on-error`, because
promotion depends on them.
  - The final image is built on the fresh base image **by digest**.
- A `repository_dispatch` is sent with a `coder-ghcr-dispatch` token
(`contents: write` on `ghcr-publisher` only).
- The job waits until every public tag serves the expected digest,
before the GitHub release is published.
- `latest` is no longer built here. The separate latest SBOM asset is
dropped; it described the same image.
- **docker-base.yaml**
- Only checks, on PRs that touch them, that `Dockerfile.base` builds for
every platform. It no longer publishes, and no longer needs `packages:
write`.
- Non-release and local builds keep using
`ghcr.io/coder/coder-base:latest`. coder/ghcr-publisher moves it to the
base of each new highest stable release (roughly weekly for 2.39),
instead of the Monday/Wednesday/Friday rebuild. So preview images and
the `coder-preview:main` scan see Alpine updates about weekly, and a
`Dockerfile.base` change reaches preview images at the next stable
release. Release images always build a fresh base.
- **verify-releases.md**
- Releases since 2026-11-16 (#32212) are built on `release/X.Y`, so the
documented `--source-ref refs/tags/vX.Y.Z` and cosign identity fail for
current releases.
- Checked: `gh attestation verify` on v2.39.4 fails with the tag ref and
passes with `refs/heads/release/2.39`. v2.39.1 still passes with its
tag. Cosign verifies v2.39.4 with the new identity.

### Review fixes (second commit set)

Two independent reviews (one functional, one adversarial) found the
following, now fixed:
- **A writer could get a real release to attest their image.** The index
was built from, and its digest read back from, mutable staging tags. A
writer moving `coder-staging:vX` mid-release could get their image
attested. Now every digest comes from the registry's response to our own
push (`docker push`, `docker manifest push`, depot, `helm push`), the
index is built from per-arch **digests**, and syft and cosign run on
`image@digest`. Tested against a local registry with Docker 29: each
parsed digest matches what the registry stores, and the index contains
exactly the pushed children.
- **Commit binding.** The provenance commit field is the dispatched
branch head, not the released commit (which differs whenever an older
commit is released). Each artifact now gets a release attestation
(`https://coder.com/attestations/release/v1`) stating version, commit
and target package, and the publisher requires it, plus an approved
`release` environment on the run.
- **Re-runs:** a tag an earlier attempt promoted is accepted, and the
publisher keeps that build.
- **Tokens:** the tagging and promotion App tokens are revoked right
after use.
- **Docs:** `SOURCE_REF` is now correct for RCs (checked in bash and
PowerShell).

Image *provenance* attestations are best-effort again, as before; the
publisher relies on the release attestations instead.

### Prerequisites (all done 2026-11-22)
1. coder/ghcr-publisher#1 and coder/ghcr-publisher#2 merged (#2 checks
the release attestations this PR now produces).
2. The staging packages exist (created 2026-11-20), with coder/coder
**Write** and `ghcr-publisher` **Read** set under Manage Actions access:
`coder-staging`, `coder-base-staging`, `chart-staging/coder`,
`chart-staging/coder-provisioner`, `chart-staging/coder-ai-gateway`.
3. The `coder-ghcr-dispatch` App exists and is installed on
`ghcr-publisher` only (coder/gcp#472, coder/github-org-terraform#206),
and `CODER_GHCR_DISPATCH_APP_ID` and `CODER_GHCR_DISPATCH_APP_KMS_KEY`
are set in the `release` environment. `coder-release-publisher` is
uninstalled from `ghcr-publisher`.

### After merge
- Backport to release/2.39, 2.38, 2.37, 2.34 and 2.29. Each branch runs
its own `release.yaml`.
- After one real release promotes successfully, switch the five public
packages to coder/coder **Read** and ghcr-publisher **Write**. Only then
is the overwrite path closed.

Tested:
- The publisher's checks against the real v2.39.4 attestations: pass on
the right ref, fail on a wrong ref, wrong commit or wrong signer.
- The anonymous digest lookup against live image, base and chart tags
(matches crane).
- actionlint and zizmor are clean.
- No release has run with this yet.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:05:46 -05:00
…
…

Coder Logo Light Coder Logo Dark

Self-Hosted Cloud Development Environments and AI Agents

Coder Banner Light Coder Banner Dark

Quickstart | Docs | Why Coder | Premium

discord release godoc OpenSSF Best Practices OpenSSF Scorecard license Ask DeepWiki

Coder is a self-hosted platform for cloud development environments and AI coding agents. Workspaces are defined with Terraform, connected through a secure Wireguard® tunnel, and automatically shut down when not used. Coder Agents runs a native AI coding agent whose loop executes in the control plane on your infrastructure, with no API keys in workspaces.

  • Define cloud development environments in Terraform
    • EC2 VMs, Kubernetes Pods, Docker Containers, etc.
  • Automatically shutdown idle resources to save on costs
  • Onboard developers in seconds instead of days
  • Delegate coding work to AI agents on your infrastructure
    • Bring any model (Anthropic, OpenAI, Google, Bedrock, self-hosted)
    • No LLM credentials in workspaces, user identity on every action
    • Centralized model governance, cost tracking, and audit logging

Coder platform showing templates and a running workspace

Quickstart

Check out our install guides for other methods and a complete tutorial.

Try Coder with the install script on Linux and macOS, or grab the latest binary or installer from GitHub Releases on Windows:

curl -fsSL https://coder.com/install.sh | sh

Start the server and open http://localhost:3000 to create your initial user, create a Docker template, and provision your first workspace:

coder server

For a production deployment, add a PostgreSQL database (version 13 or later) and an external access URL, and see our validated architectures for sizing and infrastructure guidance:

coder server --postgres-url <url> --access-url <url>

Without these flags, Coder uses a built-in database and sets up a *.try.coder.app access URL for evaluation. Use coder --help for the full list of flags and environment variables.

Documentation

Browse the documentation or visit a specific section below:

  • Workspaces: Workspaces contain the IDEs, dependencies, and configuration information needed for software development
  • Templates: Templates are written in Terraform and describe the infrastructure for workspaces
  • Coder Agents: Delegate coding work to AI agents running on your self-hosted infrastructure
  • AI Gateway: Centralize authentication, auditing, and cost controls for AI tooling
  • Administration: Learn how to operate Coder
  • Premium: Learn about paid features built for large teams
  • IDEs: Connect your existing editor to a workspace

Support

Open an issue for bugs and feature requests.

For community support, showcasing what you built, and feedback on in-progress features, join our Discord or GitHub Discussions.

Dedicated support is included in Coder Premium. For more information, visit coder.com/pricing.

Integrations

New integrations are always in progress. Open an issue to request one. Contributions are welcome in any official or community repository.

Official

Community

Contributing

New contributors are always welcome. If you are new to the Coder codebase, see the contribution guide to get started.

Hiring

Apply on the careers page if you are interested in joining the team.

S
Description
No description provided
Readme AGPL-3.0
2.3 GiB
0 Stars 1 Watchers 0 Forks
Languages
Go 73.5%
TypeScript 24.3%
Shell 0.9%
PLpgSQL 0.3%
Go Template 0.2%
Other 0.5%