serving-workers-production.yaml closes that gap.
scripts/ci/serving-workers-apps.mjs holds this table. Each app also needs an
admitted entry in productionPublicationPolicy (tuturuuu.ci.ts); a held
entry or a productionAppExclusions line keeps plan from selecting that app
and stops the publisher.
Flow
On every push toproduction:
planruns in thecloudflare-release-productionenvironment (production branch only). Without theSERVING_WORKERS_CLOUDFLARE_API_TOKENsecret it selects nothing. Otherwise it reads each app’s public/api/build-infoand selects every app that does not serve the production SHA yet, so a failed or skipped earlier promotion is retried by the next one.- Each selected app’s own workflow runs through
workflow_callat the exact production SHA and seals its production artifact. Its qualification-onlynativejobs do not run on the production ref. serving-worker-publish.yamlruns one app at a time perserving-worker-publish-<app>concurrency group. It restores the sealed archive, reruns the seal verifier and converts the archive’s own emitted config to cf Build Output withvoid-cf-output.mjs. Cron triggers stay configured on the Worker and are never part of a version, so they are left out of the uploaded config and checked against the live schedules instead.- The publisher refuses a split deployment (another rollout is in progress) and any source that is not a fast-forward of the live build, and skips when live already serves the SHA.
void-cf-publisher.mjs publish --strictuploads one version with no traffic and rejects any binding that differs from the serving version.- The candidate is staged at 0% beside the serving version and smoked through
the
Cloudflare-Workers-Version-Overridesheader, including through the apex gateway mount, once the override reaches the candidate (deployment writes take a few seconds to propagate). Build-info must report the SHA on every origin, each probe must match the serving status and redirect, and the page’s scripts and stylesheets must return 200. Afterwards the serving version is restored alone and must read back steadily, so nothing changes for readers yet. void-cf-publisher.mjs assign --expect-current <serving>moves 100% of traffic only while the captured version still serves, then waits for the public build-info to report the SHA. On failure the captured version is restored, but only over a deployment this run wrote; another writer’s deployment is left in place and recorded.
serving-<app>-publication-<sha>-<run>-<attempt>
artifact, retained 90 days, including the rollbackVersion that served before.
Stop, retry and roll back
- Stop. Set the repository variable
SERVING_WORKERS_PUBLICATIONto anything other thanenabled. New runs build and publish nothing. A job reads the variable when it starts, so cancel the workflow run to stop a publisher that is already running. Cancelling leaves the current step as it is, which can be a 0% stage or a just-assigned candidate; restore the receipt’srollbackVersionas described below. - Retry one app. Dispatch
serving-workers-production.yamlonproductionwith that app. It rebuilds only if the app does not serve the SHA yet. - Roll back. Read
rollbackVersionfrom the receipt and runcf workers deployments create --worker <worker> --strategy percentage --versions '[{"version_id":"<rollbackVersion>","percentage":100}]'. Routes, custom domains, schedules and the gateway are never changed by this flow.
Activation
Every enabled run publishes each admitted app whose live build differs from the pinned production SHA, so any regression in that SHA ships with it. Before settingSERVING_WORKERS_PUBLICATION=enabled, confirm the pinned production SHA
has no known regression for an admitted app, for example by smoking each app’s
candidate from that SHA at 0%. While a pinned production SHA carries a known
regression, keep the variable unset or move that app to held in
productionPublicationPolicy until a fixed SHA is pinned.
Credentials
SERVING_WORKERS_CLOUDFLARE_API_TOKEN is an environment secret on
cloudflare-release-production, scoped to Workers Scripts edit on the
production account only, with no zone permissions. CLOUDFLARE_ACCOUNT_ID and
NOVA_ABUSE_GUARD_FAMILIES are repository variables. Rotate the token through
the token ledger and set it with gh secret set --env from standard input so it
is never printed.
Local release
When CI runners are unavailable, mirror the app’s own artifact job on a trusted host at the production SHA, pack the archive the same way, then run the same publisher with the same environment:/proc; on macOS run them in a
Linux container, and pack archives with COPYFILE_DISABLE=1 so macOS metadata
files do not enter the sealed tree. A shallow checkout drops the roadmap commit
metrics, so build roadmap from full history.