Build and release automation
Build and release automation coordinates the repository's shared workspace and its delivery checks. It keeps product packages on a usable dependency graph, keeps release metadata consistent, and turns source changes into builds, contributor data, translation updates, release notes, and catalog packages. For the wider delivery path, see Build, release, and deployment and Deployment targets and operations.
Workspace orchestration
The workspace is the shared build boundary for Trilium's apps and packages. pnpm discovers projects below apps/ and packages/, links local packages, and applies one dependency policy across the tree. The root package declares pnpm 12.20.0 as the preferred package manager, while the workspace allows small version differences so local work is not blocked by an exact tool version. Root commands then provide a stable interface for work on one project or on the whole workspace.
Workspace graph
The workspace joins product apps with shared libraries instead of treating each app as a separate repository. This lets a shared package change flow through the client, server, desktop shell, standalone app, mobile wrapper, documentation builder, website, and extension while each project keeps its own build and test commands.
The root package uses pnpm filters to route a command to a named project. CI installs from the lockfile with --frozen-lockfile, so automation builds the dependency graph recorded for the change instead of silently resolving a new graph. The workspace policy also centralizes compatibility pins, package patches, optional dependency exclusions, and build permissions. It permits normal installs to proceed without release-age delays and allows small pnpm version differences.
The policy keeps shared runtimes at compatible versions when packages depend on one shared instance. It also carries security patches, excludes optional dependencies that a target does not use, and controls which install-time builds can run. These rules protect type contracts and runtime object identity across package boundaries while avoiding unwanted native or platform-specific downloads.
References: pnpm-workspace.yaml• L1-12 pnpm-workspace.yaml• L14-48 pnpm-workspace.yaml• L113-147 package.json• L8-62 package.json• L101-110 apps/…/package.json• L19-29 apps/…/package.json• L46-53
Script entry points
The root package.json groups common actions by purpose. These commands are the normal starting points for local work and for CI jobs that need one consistent name across platforms. Release commands also give maintainers one path from changelog entries to a tagged release.
| Script group | System purpose |
|---|---|
client:*, server:*, desktop:*, standalone:*, website:* | Build, run, or test a product surface through its workspace package. |
test:*, typecheck, dev:* | Check the shared workspace through tests, type checks, and lint or format checks. |
docs:*, edit-docs:* | Build or edit the documentation sources that feed the published docs. |
changelog:*, chore:release* | Draft, lint, and publish release notes, or guide a complete release. |
chore:*, update-contributors | Refresh versions, build identity, release text, dependency pins, and contributor data. |
Package-level scripts own product-specific behavior. They cover build and test checks, production packaging, documentation editing, and generated asset work. The documentation editor also regenerates source-driven API pages and compact API references used by documentation tools. The icon pack builder owns generated icon assets, including brand icon inputs. Root scripts mainly select the package and preserve a common command shape for engineers and workflows. The full test entry point combines checks that can run in parallel with ordered checks for packages that must not run together.
Release scripts own the work that must cross package and release boundaries. They prepare release notes, update the version set, and start the tagged release path without requiring each maintainer to remember the same sequence of commands.
References: package.json• L8-62 apps/…/package.json• L9-20 apps/…/package.json• L12-17 apps/…/package.json• L13-30 apps/…/package.json• L19-25 apps/…/package.json• L5-24 apps/…/openrouter.svg• L1 apps/…/package.json• L7-28 apps/…/package.json• L7-14 apps/…/package.json• L5-25
Development validation
The development workflow checks the workspace on pushes and pull requests for the main development and release branches. It installs the locked dependency graph, runs shared type and script checks, and exercises product packages. It also builds and checks Docker images as a separate path, so image validation does not wait for the longer test suites.
The workflow detects the affected server, standalone, and CKEditor 5 test areas from workspace and package paths. It keeps those jobs present for branch protection even when their steps are not needed. CKEditor 5 runs in parallel shards and merges its reports before applying the package-wide coverage gate. Docker image assembly runs beside the test suites, then a separate job checks both Dockerfile variants by starting the image, waiting for health, and checking non-root execution.
This diagram shows how a change moves through shared checks, affected test suites, and container checks.
flowchart LR
C[Source change] --> F[Affected-area detection]
C --> D[Shared type and package checks]
F --> S[Server and standalone tests]
F --> K[CKEditor 5 test shards]
K --> M[Merged coverage gate]
C --> B[Docker image build]
B --> H[Container health and runtime checks]
References: .github/…/dev.yml• L27-98 .github/…/dev.yml• L99-333 .github/…/dev.yml• L334-444 .github/…/dev.yml• L451-579 .github/…/dev.yml• L590-690
Standalone app deployment
The standalone app workflow turns changes to the client, standalone app, or shared core into a web build. It runs on matching pull requests for preview deployments and on changes to main for the production app. A manual run provides another way to start the same build path.
The workflow installs the locked workspace, writes build identity data, and builds the standalone package. The deploy step runs only in the main repository. It sends the build output to the app host and can add a preview link to the pull request, so forks and pull requests do not gain production deployment access.
References: .github/…/deploy-app.yml• L3-24 .github/…/deploy-app.yml• L25-37 .github/…/deploy-app.yml• L44-74
Website deployment
The website workflow builds the public website when website sources change on main or stable, during pull requests, and after a release. Pull requests produce a preview artifact. Non-pull-request runs in the main repository publish the site to Cloudflare Pages.
The workflow keeps the build and publication steps separate. This lets fork pull requests build without deployment secrets while a trusted preview path publishes the resulting files for review. Web clipper release tags are excluded so extension releases do not trigger a website deployment. Production publication uses a fixed Wrangler version and selects main for release events instead of deploying under the release tag name.
References: .github/…/website.yml• L1-20 .github/…/website.yml• L24-43 .github/…/website.yml• L44-64 .github/…/action.yml• L18-33
Cloudflare Pages previews
Cloudflare Pages preview automation publishes a static build that an unprivileged pull request job has already produced. A privileged reusable workflow runs only in the main repository. It receives the build and pull request metadata through a small workflow-call interface, validates that the metadata names the commit that ran the build, and then deploys the files without checking out or executing pull request code.
The workflow rejects Cloudflare server-side entry points because these previews are static and must not gain access to project bindings. It deploys with a fixed Wrangler version and updates or creates a pull request comment with the preview URL. Concurrency cancels an older preview for the same branch so a slower build cannot replace a newer one.
This diagram shows the trust boundary between the pull request build and the privileged preview publication.
flowchart LR
P[Pull request build] --> A[Static site artifact]
P --> M[Preview metadata]
A --> V[Artifact and commit validation]
M --> V
V --> C[Static entry-point check]
C --> D[Cloudflare Pages preview]
D --> R[Pull request comment]
References: .github/…/cloudflare-preview.yml• L1-7 .github/…/cloudflare-preview.yml• L11-29 .github/…/cloudflare-preview.yml• L31-68 .github/…/cloudflare-preview.yml• L69-112 .github/…/cloudflare-preview.yml• L114-176
Documentation build
The documentation build turns Trilium note sources into static site files. It prepares a build environment, imports source notes, and exports configured notes into the site output. The share theme is built first so exported pages use the current presentation.
A configuration file can define several source and export mappings. When no configuration is present, the legacy path still builds the user and developer guides.
References: apps/…/build-docs.ts• L61-87 apps/…/build-docs.ts• L179-230 apps/…/build-docs.ts• L288-329 apps/…/package.json• L9-20
Documentation synchronization
The documentation editor keeps note exports and source-generated pages in sync. It reads mappings from a configuration file, regenerates OpenAPI and TypeScript API pages before import, and exports note trees back to stable files. The same pipeline supports an interactive Electron editor and a headless synchronization command, so local editing and automation use the same data rules.
TypeDoc pages can produce two related outputs. The user-facing page presents the selected API and links its related types. A compact declaration reference supports skill sheets and other readers that need the API contract in a small form. The pipeline also derives in-app help metadata and content from the exported User Guide tree.
When [generated API page] is configured, its note ID must resolve to a Markdown data file in the mapped export. This keeps generated content attached to the intended note instead of creating an untracked page.
This diagram shows how source contracts become generated documentation and help data.
flowchart LR
S[OpenAPI or TypeScript source] --> G[Generated Markdown and API reference]
G --> I[Note import]
I --> E[Documentation export]
E --> H[Help metadata and content]
References: apps/…/docs_pipeline.ts• L24-66 apps/…/docs_pipeline.ts• L171-243 apps/…/docs_pipeline.ts• L266-335 apps/…/typedoc_markdown.ts• L21-110 apps/…/typedoc_markdown.spec.ts• L125-377 apps/…/utils.ts• L15-25
Build artifact assembly
The shared build helper gives product packages one flow for creating a clean output directory and assembling runtime files. It bundles backend entry points into the required runtime format, can keep lazy ESM boundaries as separate chunks, and combines backend and frontend outputs with required external modules. It then removes files that a target artifact cannot use.
Native dependencies stay aligned with the requested platform and architecture rather than only the machine that runs the build. CI can pass a target architecture that differs from the runner, and the helper checks that the matching native module exists before it trims unused files. This makes stale or incomplete dependency trees fail before packaging.
References: scripts/build-utils.ts• L6-19 scripts/build-utils.ts• L40-65 scripts/build-utils.ts• L172-195 scripts/build-utils.ts• L199-293 scripts/build-utils.ts• L306-313
Workspace cleanup
The workspace cleanup script removes the root and direct package dependency directories. It provides a known starting state when local dependency trees contain stale or incompatible files without changing source files or the lockfile.
References: scripts/wipe-node-modules.mts• L5-20 scripts/wipe-node-modules.mts• L23-29
Version and build metadata
Version automation keeps the product packages aligned enough for release checks and gives each build an identity that can be traced back to source. The release workflow treats the version in the tag and the checked package metadata as one contract.
Version alignment
The root package version is the source used by scripts/update-version.ts for the main application and shared runtime packages. scripts/check-version-consistency.ts is the release gate: it accepts a release tag, normalizes a leading v, and checks the root package plus the server, client, desktop, and commons package versions.
The release sanity job installs only the source filter and skips lifecycle scripts before it checks this contract. This is a focused pre-build check rather than a rule that every workspace package has the same version. The client, server, desktop, edit-docs, and standalone manifests share the application version, while build-docs and icon-pack-builder keep independent tool versions and the website has no version field. The mobile wrapper, website, extension, and documentation tool have separate package lifecycles. A version change must therefore include every package that ships in the release and any external package or flake that carries its own version contract.
References: scripts/update-version.ts• L4-35 scripts/check-version-consistency.ts• L5-35 .github/…/release.yml• L13-33 .github/…/release.yml• L147-188 apps/…/package.json• L1-4 apps/…/package.json• L1-4 apps/…/package.json• L1-4 apps/…/package.json• L1-4 apps/…/package.json• L1-4 apps/…/package.json• L1-5 apps/…/package.json• L1-5 apps/…/package.json• L1-4 apps/…/package.json• L1-14 apps/…/package.json• L1-13
Build identity
The build-info step writes the current UTC build time and Git revision into the shared core package. Desktop, server, and mobile build flows run this step before packaging, so a delivered build can report when it was made and which source revision produced it.
Nightly builds use a different version policy from tagged releases. CI derives a date-and-time suffix from the base version before building desktop and Docker nightlies. A released version first gets a higher patch number, a beta loses its beta marker, and an existing nightly loses its old date before the new suffix is added. The suffix makes browser and asset caches treat each nightly as a new build without changing the committed release version.
Nightly automation builds desktop and server packages for supported operating-system and architecture pairs, builds a signed mobile APK, and drafts notes for the changes since the last release. Runs on main publish the rolling nightly release. Other runs retain their outputs as workflow artifacts, which lets pull requests and branch checks exercise the matrix without changing the public nightly release.
References: scripts/update-build-info.mts• L4-21 scripts/update-nightly-version.ts• L21-71 scripts/update-nightly-version.spec.ts• L5-17 .github/…/action.yml• L91-107 .github/…/action.yml• L52-62 .github/…/nightly.yml• L17-27 .github/…/nightly.yml• L34-143 .github/…/nightly.yml• L144-228 .github/…/nightly.yml• L230-290
Dependency refreshes
Some dependency updates need related generated or pinned data to move with them. Dedicated tools make those relationships explicit, verify the result, and open a reviewable pull request instead of allowing a partial update to reach a build.
| Update concern | Coordinated result |
|---|---|
| Electron | The desktop dependency, exact binary and header pins in flake.nix, and the recorded platform locale entries stay aligned. |
| PDF.js | The npm dependency and the vendored viewer move together and are tested as one unit. |
| Language-model prices | The committed price table is refreshed from upstream data and remains part of the build input. |
Renovate handles ordinary dependency proposals. Special workflows own updates with cross-file or upstream-data contracts. The PDF.js updater checks npm on a schedule or by manual request. When a newer release exists, it updates the package and lockfile, refreshes the matching vendored viewer, runs unit and browser checks, and opens one reviewable pull request. This keeps the viewer and library at the same version; scheduled pull requests run these checks in the updater because their own pull-request workflows do not provide the needed coverage. The model-price workflow refreshes the committed table from upstream data and opens a pull request only when the table changes. Builds use that committed table rather than fetching prices at build time.
The Nix update workflow reacts to a desktop Electron change on main or to a manual run. It refreshes the matching binary pin, verifies the binary and headers with Nix, and opens a pull request only when the flake changed. Its concurrency rule keeps quick successive Electron bumps from racing over the same update branch.
The Electron locale updater records the locale files shipped by the exact desktop Electron version. It reads the names from the Linux, Windows, and macOS release archives with range requests, then writes the platform-specific fixture used by desktop packaging tests. It avoids downloading full archives and fails when a platform has no matching locale entries, so a packaging test cannot pass against an empty or stale locale list.
The PDF.js updater owns the complete dependency and viewer change. It does a full locked install after changing the lockfile, reapplies the local viewer changes, runs unit and browser checks, and opens one pull request only when the upstream version changes. This prevents a library-only update from reaching the workspace with a viewer that rejects it at runtime.
This diagram shows the related Electron version data that must move together.
flowchart LR
E[Desktop Electron version] --> F[Flake binary and header pins]
E --> L[Platform locale fixture]
F --> N[Nix validation]
L --> T[Desktop locale trimming checks]
References: scripts/update-flake-electron.ts• L38-59 .github/…/update-nix-flake.yml• L3-15 .github/…/update-nix-flake.yml• L16-28 .github/…/update-nix-flake.yml• L62-93 scripts/update-electron-locales.ts• L1-19 scripts/update-electron-locales.ts• L62-80 scripts/update-electron-locales.ts• L82-124 scripts/update-electron-locales.ts• L127-197 scripts/update-electron-locales.spec.ts• L9-76 .github/…/update-pdfjs-viewer.yml• L1-17 .github/…/update-pdfjs-viewer.yml• L19-26 .github/…/update-pdfjs-viewer.yml• L31-92 .github/…/update-pdfjs-viewer.yml• L93-168 packages/…/update-model-prices.ts• L1-15 .github/…/update-model-prices.yml• L1-53 renovate.json• L34-43
Contributor and translation automation
Contributor and translation automation keeps public project data tied to source history and translation service state. The workflows use thresholds and explicit locale lists so that a language is not shown as available until the product can offer it and generated files have clear owners.
Contributor records
The contributor update reads non-merge commits in the source and app areas, separates translation-heavy work from development work, and resolves eligible authors to GitHub profiles. It preserves pinned roles in contributors.json and regenerates the remaining entries from local history.
The resulting file is generated data. Maintainers should change role pins by hand only when they need to preserve special attribution. Ordinary contributor changes should come from pnpm run update-contributors.
References: scripts/update-contributors.ts• L31-56 scripts/update-contributors.ts• L98-129 scripts/update-contributors.ts• L180-212 contributors.json• L1-43
Translation coverage
Weblate is the source of translation coverage data for the client, website, and README projects. The shared translation helper reads every page of the public Weblate API and may reuse a local cache for one day. The coverage check fails when a language is more than 50 percent translated but is missing from a product's supported locale list.
The client and website keep separate lists because their display-language support is not identical. A content-only locale can label notes but cannot act as a product display language, so the check treats it as unavailable. The helper also rejects future-dated cache files and reports the URL of a failed Weblate page. This prevents a partial or frozen API result from hiding a language that needs a locale-list update.
The internationalization workflow runs only for pull requests authored by Weblate. It checks the coverage script with Node 24, so translated changes cannot pass without matching the client and website locale lists.
This diagram shows how translation service data is compared with the locale lists before automation accepts a change.
flowchart LR
W[Weblate coverage] --> C[Coverage check]
A[Client locale list] --> C
S[Website locale list] --> C
C -->|all covered languages are offered| P[Pass]
C -->|translated language is missing| F[Fail]
References: scripts/…/utils.mts• L6-10 scripts/…/utils.mts• L25-36 scripts/…/utils.mts• L38-63 scripts/…/utils.mts• L65-100 scripts/…/check-translation-coverage.mts• L7-61 scripts/…/utils.spec.ts• L5-85 packages/…/i18n.ts• L1-13 apps/…/locales.ts• L7-39 .github/…/i18n.yml• L1-21
README translation base
The root README is the human-edited source. docs/README.md is a path-adjusted base for Weblate, which uses it to create translated README files under docs/. The sync script refreshes the language switcher from README coverage and rewrites links for the docs/ location. The switcher includes locales above 75 percent coverage.
When the root README changes on main, the main repository workflow regenerates both files and opens a pull request only when the output differs. A manual run is also needed when coverage crosses the 75 percent threshold without a README change. The workflow cancels an older run when a newer README state supersedes it.
References: scripts/…/manage-readme.ts• L10-49 .github/…/sync-readme.yml• L3-27 .github/…/sync-readme.yml• L32-83
Release-note generation and publication
Release-note automation turns source history and maintainer-written change entries into a versioned note, then turns that note into the body used by GitHub Releases. It keeps the public record tied to the changes in the release and checks the note before publication.
Release note generation
The release note generator builds a note from changes since a previous release. It reads commit history and merged pull requests through GitHub, then combines closed issues, new display languages, compatibility changes, and entries in .changelog/. The release template places these items in stable sections while leaving separately shipped website and web clipper changes out of the main application note.
A change can close an issue directly through a closing keyword in a commit or through the closing issues recorded on its merged pull request. The generator maps conventional commit types and areas to note sections, links the issue title, and credits the contributor who made the change. An explicit changelog entry replaces the generated issue item when both describe the same change. Its closes field can name issues or pull requests, so one entry can also cover the issues closed by that pull request.
New display languages are detected by comparing the locale list at the previous release with each later revision. The note credits translators by the lines they add to the language catalogues. A sync protocol or database version change becomes a Compatibility item, with related entries nested under the version change so the note explains both the new contract and the work that caused it.
Changelog entries use timestamped Markdown files with small frontmatter. The type selects the note section, area groups fixes and improvements, closes links related issues or pull requests, and credits overrides inferred attribution. A final release needs exactly one overview entry. Highlights need a title, while fixes and improvements need a known area. The lint path reports malformed entries instead of guessing their meaning.
The generator can also print an unreleased note for nightly builds. That form omits the template preamble and empty sections, and it adds the build revision to the note. The --unlisted mode reports user-facing pull requests and commits that have no issue closure or changelog entry, while announce-nightly marks newly closed issues on GitHub. After a final note is accepted, consume deletes its entries; a release candidate or beta moves them to .changelog/pre-release/ so the final release can list them again.
This diagram shows how source history and curated entries become a release note or a nightly note.
flowchart LR
H[Commit and GitHub history] --> C[Change collection]
L[Changelog entries] --> C
I[Locale and compatibility changes] --> C
C --> T[Release template]
T --> N[Versioned release note]
C --> U[Unreleased nightly note]
N --> X[Consumed changelog entries]
References: scripts/release-notes.mts• L1-42 scripts/release-notes.mts• L261-343 scripts/release-notes.mts• L393-455 scripts/release-notes.mts• L511-704 scripts/release-notes.mts• L778-862 scripts/release-notes.mts• L1075-1315 scripts/release-notes.mts• L1337-1408 scripts/release-notes.spec.ts• L15-194 scripts/release-notes.spec.ts• L196-308 scripts/release-notes.spec.ts• L311-375 scripts/release-notes.spec.ts• L496-664 scripts/release-notes.spec.ts• L666-708
Changelog feedback
Changelog feedback reports lint results back to the pull request without executing pull request code in a write-capable job. The lint workflow stores the result as an artifact. A follow-up workflow validates the pull request number against the commit that produced the artifact, then creates or updates one bot comment with the problems or a success message.
The comment treats artifact content as untrusted text. It limits the displayed list and cleans markup, line breaks, and mentions before posting. This gives contributors a visible correction loop while keeping write access outside the pull request execution context.
References: .github/…/changelog-comment.yml• L1-21 .github/…/changelog-comment.yml• L23-40 .github/…/changelog-comment.yml• L43-76 .github/…/changelog-comment.yml• L78-125
Stable release publication
The tagged release workflow checks version consistency before it builds release outputs. It builds desktop, server, mobile, and Docker artifacts in parallel, gathers the artifacts after all required jobs succeed, and publishes one GitHub release with the rendered release note. Release candidates remain prereleases, while other tagged releases can become the latest release.
The release body is composed separately because note images use paths relative to the notes directory. The publication step merges the platform artifacts and requires every expected file, so a missing build cannot produce a partial stable release.
References: .github/…/release.yml• L1-33 .github/…/release.yml• L34-115 .github/…/release.yml• L116-188 .github/…/release.yml• L190-214 .github/…/release.yml• L216-260 scripts/release-notes-body.mts• L1-120
Windows package publication
Stable GitHub releases also feed the Windows package catalog. The WinGet workflow ignores prereleases and web clipper releases, then publishes the main application identifier from the release tag. A manual run can select a tag when a catalog update needs to be retried.
References: .github/…/release-winget.yml• L1-24
Change checklist
When these files or sections are changed, remember to consider these:
- Change the root version and every release-gated package together. Run the version consistency check with the exact tag form that CI will receive.
- Change a package script, package version, or workspace dependency together with the root filter, workflow path, and artifact consumer that invokes or publishes it.
- Change a workspace override, patch, ignored optional dependency, or build permission only with the package and target that depend on that policy. Regenerate or validate the lockfile through the locked install path.
- Change Electron only with its
flake.nixpin, hashes, and apps/…/electron-locales.json fixture. Run both update tools when the desktop Electron version changes. - Change PDF.js only through the PDF.js update path so the matching vendored viewer and its checks move with it.
- Change an OpenAPI or TypeScript API source together with its documentation mapping, note ID, generated Markdown output, and any compact skill reference that consumes it.
- Change TypeDoc selection or naming rules together with the page links and declaration references that depend on its headings.
- Change a locale list when Weblate coverage crosses the supported-language threshold. Check the client and website lists separately.
- Change README content through the README sync path so docs/README.md remains a valid Weblate base with correct relative links.
- Add release-note images beside the note or update their relative paths. Confirm that the tag-named note exists before creating the release tag.
- Change the release artifact name or directory only with the matching upload and publish paths in the release workflows.
- Change the build target, target architecture, or native dependency layout only with the artifact assembly, target-architecture selection, and platform-specific runtime files that consume it.
- Change the documentation source mapping only with the generated site paths and the share theme build that feeds them.
- Change the standalone app inputs or output directory only with the workflow path filters and the deployment action that publishes previews and production builds.
- Change the website build inputs or output directory only with the website path filters, Cloudflare deployment action, and preview upload path.
- Change the Cloudflare preview artifact or metadata contract only with the upload workflow, commit validation, static-entry-point check, and pull request comment that consume it.
- Change nightly release conditions, version rules, or target matrices together with the publish paths for the
nightlyrelease and the non-main artifact paths. - Change the web clipper archive names or tag patterns together with release asset selection, browser-store submission inputs, and the Firefox signing path.
- Change the workspace install policy together with the lockfile and all workflows that rely on frozen installs, including focused release installs.
- Change the Flatpak manifest placeholders, pnpm version, or source-generation rules together with the release repository update, architecture hashes, offline source file, and local test build.
- Change the local Flatpak source inputs only with the lockfile stamp and the test app identity. Rebuild sources when the lockfile changes.
- Change the affected-area filters in development checks together with the package dependency closure and the required-check job structure.
- Change the release tag or Windows package identifier only with the WinGet publication workflow and its manual retry path.
- Change the Flathub manifest inputs or source-generation rules together with the external repository pull request and metadata validation path.
- Change a Dockerfile, target platform, image tag, or digest name together with the image test matrix and the manifest publication steps for both registries.
- Change stable image tags or legacy repository names together with the reusable mirror workflow and its per-repository tag rules.
- Change release-note section names, changelog frontmatter, overview or highlight rules, or issue and pull-request closing rules together with the generator, lint command, release CLI, and release-note tests.
- Change release version suggestion rules or the version-file list together with package version propagation, release pre-flight, tag handling, and stable-branch update steps.
- Change changelog lint artifact names or pull request metadata together with the write-capable comment workflow. Keep commit validation and text sanitization aligned with the artifact contract.
- Change the stable release artifact set together with desktop, server, mobile, Docker, release-body, and WinGet publication paths.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A release tag does not match the checked package versions | The release stops before artifact builds start. | check-version-consistency.ts runs in the release sanity job. |
| A package script or workspace dependency changes without the matching workflow or root filter | CI can invoke a missing command or omit a package that affects the output. | Product manifests, root scripts, and workflow filters must keep the same package contract. |
| A tagged release has no matching note or a note points to a missing image | Release-body composition fails and GitHub does not publish the release. | release-notes-body.mts checks the note and every rewritten image path. |
| A release changelog entry has invalid frontmatter, an invalid area, or a final release has no single overview | Note generation leaves the entry out or the release CLI stops before preparation. | release-notes.mts parses and lints entries, requires one overview for a release, and requires titles for highlights. |
| A release note is drafted from stale or unconsumed changelog entries, or a changelog entry does not name a related pull request | The public note can omit later edits, duplicate a change, or show a generated issue item instead of the maintained wording. | The release CLI checks the note inputs and closes links let curated entries replace generated issue and pull-request items before entries are consumed. |
| A changelog lint artifact names a pull request that moved after the lint run | The bot does not post stale results to the pull request. | changelog-comment.yml compares the claimed pull request head with the workflow run SHA. |
| Changelog feedback contains markup or an accidental mention | A bot comment can be malformed or notify unrelated users. | The comment workflow strips control markup, limits each message, and inserts a zero-width space before @. |
| A translated language passes the Weblate threshold but is absent from a product locale list | The internationalization workflow fails instead of leaving the language translated but unavailable. | check-translation-coverage.mts compares both product lists with Weblate. |
| The Electron package moves without the flake pin or locale fixture | Nix validation or desktop locale checks detect inconsistent release data. | update-flake-electron.ts and update-electron-locales.ts keep the related pins and recorded archive contents current. |
| Electron release archives contain no locale entries for a supported platform | The locale fixture is not written, so packaging tests cannot silently pass against an empty platform list. | collectElectronLocales rejects empty platform results and its spec covers the error. |
| A ZIP central directory is truncated or uses unsupported ZIP64 fields | Electron locale discovery fails instead of recording incomplete archive data. | The ZIP readers validate record boundaries and reject ZIP64 archives. |
| PDF.js is updated without re-vendoring its viewer | The viewer and library can reject each other at runtime. | The PDF.js update workflow owns the bump and runs unit and browser checks. |
| A dependency update workflow receives an unexpected upstream data shape | Generated data is not overwritten with an incomplete result. | The model-price updater applies provider floors before writing its committed table. |
| A workspace override, patch, ignored optional dependency, or build permission no longer matches the package graph | The locked install can fail or a target can receive duplicate or unwanted native packages. | pnpm-workspace.yaml is the single policy source and frozen installs validate its lockfile contract. |
| A stale package dependency tree supplies an old native module layout | The build fails before packaging instead of producing an artifact that cannot load its database driver. | The build helper checks for the expected native layout, and the workspace wipe script removes stale dependency trees. |
| A target architecture has no matching native prebuild or the build uses the runner architecture | Packaging fails before it can produce an artifact with a missing native addon. | CI passes the target architecture to the build helper, which checks for the requested prebuild. |
| Documentation mappings point to unavailable source data, a missing note, or a non-Markdown target | Documentation synchronization stops instead of replacing the wrong page or publishing partial generated content. | The documentation pipeline checks mappings and initializes the required build environment before import. |
| TypeDoc cannot load the configured entry point or two stripped names collide | The generated API page or skill reference is not produced. | The TypeDoc runner reports its source error, and name stripping rejects duplicate display names. |
| A standalone app change falls outside the deployment workflow's path filters | The app build or preview does not run for the change. | Keep the filters aligned with the client, standalone app, shared core, and workflow files that affect the deployed output. |
| A website change falls outside its workflow path filters or the build output changes without its deploy path | The public site or its preview does not update. | website.yml keeps source filters, build output, production deployment, and preview upload in one path. |
| A preview metadata file names a pull request whose head is not the built commit | The privileged Cloudflare job stops before it publishes untrusted or stale files. | cloudflare-preview.yml compares the metadata claim with the pull request head SHA. |
| A preview artifact contains Cloudflare server-side entry points | The preview could run code with project bindings instead of serving only static files. | The Cloudflare workflow rejects functions, _worker.js, and _routes.json before deployment. |
| A nightly run publishes from a non-main ref or misses a target artifact path | A test build can overwrite the rolling release or a nightly target can be absent. | The nightly workflow limits release publication to main and uploads other runs as artifacts. |
| A nightly derived version does not sort above the related release | Update checks can offer the stable release over the nightly build. | processVersion raises the patch for released versions and tests the beta and existing-nightly cases. |
| The release sanity job lacks the package data needed by its focused install | Version validation fails before artifact jobs can start. | The release workflow installs the source filter with the lockfile and runs the check from the checked-out scripts. |
| A stable release is missing a desktop, server, mobile, or Docker artifact | The GitHub release is incomplete or publication stops. | Release jobs fan in through required dependencies and publish with unmatched-file failure enabled. |
| A stable release reaches the WinGet workflow without a usable tag or catalog credential | The Windows package catalog is not updated. | release-winget.yml uses the release tag or an explicit manual tag and publishes with the repository's WinGet token. |
| An affected-area filter omits a shared package or workspace input | A required server, standalone, or editor check can be skipped for a change that affects it. | dev.yml keeps shared workspace and dependency-closure paths as filter anchors. |
| One CKEditor 5 shard report is missing or the merged report is not evaluated | The editor coverage gate can fail or accept incomplete coverage. | The workflow requires both shard artifacts and applies thresholds only during report merge. |
| A Docker image fails health or non-root checks | The image is not accepted for publication. | The Docker test job starts each variant, waits for health, and runs the non-root check. |
| A platform digest is missing before manifest assembly | The multi-platform image cannot be published as a complete image. | The merge job verifies every digest on GHCR before creating manifests and copying them to Docker Hub. |
| A stable release cannot copy its source image or a legacy target tag | Existing installs that use a pre-rename repository do not receive the release. | The legacy mirror copies from the published stable GHCR image and checks each target manifest. |
| A Flathub update uses a missing ref, an old pnpm major, or produces invalid app metadata | The external catalog pull request is not usable for review or merge. | The update tool resolves the ref, checks pnpm support and hashes, and the workflow runs appstreamcli validate. |
| Generated Flatpak sources omit the expected package set or Electron input | The network-less Flatpak build fails or cannot install its runtime dependencies. | The source generator checks the pnpm store version, source count, Playwright filtering, and Linux Electron archive. |
| A local Flatpak build uses a linked worktree or stale lockfile sources | The sandbox cannot read the checkout or the test app uses incomplete dependencies. | The local builder rejects linked worktrees and stamps generated sources with the lockfile hash. |
| A web clipper build does not reproduce from its source archive | The extension release can differ from the reviewed source package. | The workflow rebuilds Firefox from the sources archive and compares the output. |
| A browser-store submission runs for a release candidate or lacks its archive | An unready extension can be submitted or publication can fail. | Store submission is limited to stable tags, and archive names are mapped per store. |
Key files
| File | Why to read it |
|---|---|
| pnpm-workspace.yaml | Defines the workspace boundary and shared dependency policy. |
| package.json | Shows the root command surface, test coordination, package-manager contract, release commands, and how commands route to workspace projects. |
| Product package manifests (apps/…/package.json, apps/…/package.json, apps/…/package.json, apps/…/package.json) | Show the package-local build, test, runtime, and packaging contracts used by the main product surfaces. |
| Tool package manifests (apps/…/package.json, apps/…/package.json, apps/…/package.json, apps/…/package.json) | Show the command and version boundaries for documentation, generated assets, and website work. |
| apps/…/openrouter.svg | Illustrates a brand asset that enters the generated icon set. |
| .github/…/dev.yml | Shows affected-area checks, shared validation, parallel test work, and Docker image checks for development changes. |
| scripts/build-utils.ts | Shows how product builds bundle code and assemble target-specific runtime files. |
| apps/…/build-docs.ts | Shows how note sources become the static documentation site. |
| apps/…/docs_pipeline.ts | Shows how note mappings, generated API pages, exports, and help artifacts share one documentation flow. |
| apps/…/typedoc_markdown.ts | Shows how TypeScript API models become linked Markdown and compact declarations. |
| apps/…/typedoc_markdown.spec.ts | Shows the contract for API selection, links, names, and generated declarations. |
scripts/wipe-node-modules.mts | Shows the supported reset of workspace dependency directories. |
| scripts/update-version.ts and scripts/check-version-consistency.ts | Explain version propagation and the release version gate. |
scripts/update-build-info.mts and scripts/update-nightly-version.ts | Explain build trace data and the nightly version policy. |
| scripts/update-nightly-version.spec.ts | Shows the ordering rules for released, beta, and existing nightly versions. |
| scripts/update-flake-electron.ts and scripts/update-electron-locales.ts | Show how the desktop Electron version updates its Nix pins and recorded platform locale data. |
| scripts/update-electron-locales.spec.ts | Shows the guards for archive parsing and complete platform locale discovery. |
| apps/…/electron-locales.json | Records the locale names shipped by the pinned Electron release for desktop packaging checks. |
| .github/…/deploy-app.yml | Shows how standalone app changes become preview or production deployments. |
| .github/…/website.yml and .github/…/action.yml | Show website builds, Cloudflare publication, and the fixed production deploy tool. |
| .github/…/cloudflare-preview.yml | Shows how an already-built pull request artifact crosses into a safe Cloudflare Pages preview. |
scripts/flatpak/update-repo.mts | Shows how a release or beta ref becomes a pinned Flathub packaging recipe. |
scripts/flatpak/generate-sources.mts | Shows how the lockfile becomes the offline Flatpak dependency source set. |
scripts/flatpak/build-local.mts | Shows how a working tree becomes an isolated local Flatpak test install. |
| scripts/…/build-local.spec.ts | Shows the local manifest and ignored-path contracts. |
| .github/…/main-docker.yml | Shows Docker image validation, platform builds, digest merging, and publication to both image registries. |
| .github/…/mirror-legacy-docker.yml | Shows how stable images remain available through the pre-rename Docker Hub repositories. |
| .github/…/release.yml | Shows the stable release checks, focused install, artifact fan-in, mobile packaging, and publication path. |
| .github/…/release-winget.yml | Shows how a GitHub release reaches the Windows package catalog. |
| .github/…/release-flathub.yml | Shows how a stable release becomes a validated Flathub pull request. |
| .github/…/web-clipper.yml | Shows extension archive checks, release assets, signing, and browser-store submission. |
| .github/…/nightly.yml | Shows the cross-platform nightly matrix, mobile and server outputs, release-note drafting, and the split between published releases and workflow artifacts. |
| .github/…/changelog-comment.yml | Shows how changelog lint results reach a pull request without running pull request code with write access. |
scripts/release-notes.mts | Defines how commits, pull requests, locales, compatibility changes, and curated changelog entries become release notes. |
| scripts/release-notes.spec.ts | Shows the guarantees for closing references, note sections, changelog validation, rendering, and compatibility entries. |
scripts/release.mts | Defines the interactive release sequence, version suggestion, package version propagation, tag push, and stable-branch update. |
| scripts/release.spec.ts | Shows the guarantees for version ordering, release suggestions, package version updates, and note registration. |
scripts/release-notes-body.mts | Defines the contract between repository release notes and GitHub release bodies. |
scripts/translation/check-translation-coverage.mts and scripts/translation/utils.mts | Define the coverage threshold, Weblate pagination, cache rules, and locale comparison. |
| scripts/…/utils.spec.ts | Shows the guarantees for cache age, complete API reads, failed-page reporting, and content-only locales. |
| scripts/…/manage-readme.ts and .github/…/sync-readme.yml | Show how the root README becomes the translation base. |
| scripts/update-contributors.ts and contributors.json | Show how contributor history becomes generated public attribution. |
| .github/…/update-nix-flake.yml, .github/…/update-pdfjs-viewer.yml, and .github/…/update-model-prices.yml | Show the automated updates that protect cross-file and upstream-data contracts. |