mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-28 13:02:21 +01:00
The site build now copies install-linux.sh, install-windows.ps1, and packaging/macos/legacy-appcast.xml into its Worker assets, so the same Worker serves them at /hex/files with the Content-Type and Cache-Control the bucket objects had. The Installers and Legacy appcast workflows, r2-put.sh, and their R2 write credential are gone. The dev notes move to the one-commit dev-notes branch, published by Release's dev-notes job with GITHUB_TOKEN only; the Worker proxies that file at /hex/files/dev-notes.json (falling back to the bucket copy until the first dev release creates the branch) and renders /hex/dev from it. Both site Workers now bind hex-production-files, read-only in code, for the frozen 2.3.1 feeds and artifacts, which lets hex-dev-files go. The Site build runs the installer test and appcast check the removed workflows ran, and the verify job compares the served bytes.
36 lines
1.5 KiB
TypeScript
36 lines
1.5 KiB
TypeScript
import { bindings, defineConfig, triggers } from "cf/config"
|
|
import { BASE_PATH, hostForMode } from "./src/base.ts"
|
|
|
|
// `--mode dev` builds and deploys the dev Worker on dev.anoma.ly; any other
|
|
// mode is production on anoma.ly. One Worker serves the site at /hex and the
|
|
// files at /hex/files: the installers and appcast built with the site, the dev
|
|
// notes, and the frozen 2.3.1 feeds and artifacts, which are read from the
|
|
// production files bucket from both environments. The account comes from
|
|
// CLOUDFLARE_ACCOUNT_ID.
|
|
export default defineConfig(({ mode }) => {
|
|
const dev = mode === "dev"
|
|
const host = hostForMode(mode)
|
|
return {
|
|
worker: {
|
|
name: dev ? "hex-dev-site" : "hex-production-site",
|
|
compatibilityDate: "2026-10-13",
|
|
// /hex/download/dev fetches the release service, another Worker on this zone.
|
|
compatibilityFlags: ["global_fetch_strictly_public"],
|
|
entrypoint: "./worker.ts",
|
|
assets: { runWorkerFirst: true },
|
|
env: {
|
|
ASSETS: bindings.assets(),
|
|
// The frozen 2.3.1 history is the same for both environments and is
|
|
// only read. CI holds no R2 credential.
|
|
FILES: bindings.r2({ name: "hex-production-files" }),
|
|
CANONICAL_HOST: bindings.text(host),
|
|
},
|
|
triggers: [
|
|
triggers.fetch({ pattern: `${host}${BASE_PATH}`, zone: "anoma.ly" }),
|
|
triggers.fetch({ pattern: `${host}${BASE_PATH}/*`, zone: "anoma.ly" }),
|
|
],
|
|
workersDev: false,
|
|
previewUrls: false,
|
|
},
|
|
}
|
|
})
|