Packaging, automation, and deployment
IPTVnator uses one delivery system for desktop installers, embedded MPV support, self-hosted web images, the Android TV shell, and release checks. GitHub workflows build these outputs, check their contents and runtime links, and publish them only after the related safeguards pass. Master builds also have a separate nightly update channel. This page is a companion to Release and delivery, Client applications, and TV shell runtime.
Delivery model
The delivery model turns the product into five user-facing forms: an Electron desktop app, a browser PWA with its web backend, a public website, an Android TV shell, and release assets. Each form has different runtime limits, but the workflows apply common build, test, identity, and artifact checks before delivery.
| Delivery form | Main purpose | Delivery path |
|---|---|---|
| Electron app | Desktop playback and desktop-only features | Platform installers and archives from the build matrix |
| PWA and web backend | Self-hosted browser access | Multi-architecture Docker image |
| Public website | Release information and download access | GitHub Pages artifact and deployment |
| Android TV shell | Fire TV and Android TV access through a native shell | APK workflow artifact or optional pre-release |
| Release assets | Public distribution and update channels | Rolling drafts, tagged releases, nightly prereleases, and Snap edge uploads |
The website workflow builds only the site, stores its output as a Pages artifact, and deploys it through the GitHub Pages environment. One deployment concurrency group prevents an older deployment from replacing a newer one. A website-only pull request still checks the AppStream screenshots that the built site supplies. A missing diff, a move across the website boundary, or any other uncertain scope keeps the Electron packaging path enabled.
References: package.json• L25-82 electron-builder.json• L21-59 .github/…/build-and-make.yaml• L3-45 .github/…/deploy-website.yml• L3-62 .github/…/build-tv-shell-apk.yml• L1-42 docker/Dockerfile• L47-74 tools/…/build-workflow-scope.test.mjs• L80-195
Electron packaging
Electron packaging joins the built web client, Electron backend, worker files, and native modules into platform-specific application artifacts. Native files that need direct runtime access stay outside the application archive, and later checks verify that the final package still contains the required workers and native dependencies.
The supported output families are:
- macOS DMG and ZIP packages for Intel and ARM64.
- Windows NSIS installers and ZIP archives for x64.
- Linux AppImage, DEB, Snap, RPM, Pacman, and Flatpak packages for the configured architectures.
macOS release builds require signing and notarization credentials. Pull requests also build the macOS native runtime so packaging can be checked before release credentials are used. Release checks reject ad-hoc signatures and missing team identity, then validate the bundle with macOS security tools. They retry ticket validation only for a lost network connection. Linux startup uses the X11 platform setting because embedded MPV needs that display path. Flatpak and Snap packages carry their own sandbox permissions and runtime settings.
Package identity checks protect the public app name, operating-system playlist associations, updater metadata, and release upload set. They also compare generated Electron metadata with the root product identity. This keeps a private project name, stale updater file, or incomplete native payload out of an installer.
The after-pack stage can also add an optional Cloudflare cloudflared connector to an installer. It selects a platform and architecture-specific pinned release asset, verifies its SHA-256 digest, and ships the matching upstream license and source record with the executable. The connector is therefore an explicit packaged dependency rather than an unverified download during application startup.
References: electron-builder.json• L60-177 tools/…/electron-after-pack.cjs• L190-275 tools/…/cloudflared-bundle.cjs• L6-112 .github/…/build-and-make.yaml• L856-1045 .github/…/build-and-make.yaml• L1059-1087 .github/…/build-and-make.yaml• L1534-1574 tools/…/configure-linux-frame-copy-build.test.mjs• L43-145 tools/…/electron-package-identity.test.mjs• L153-341 tools/…/electron-package-identity.test.mjs• L551-567 tools/…/build-workflow-scope.test.mjs• L17-78
The Linux build uses separate system, portable, and flatpak passes. The system pass creates distribution packages that use host MPV libraries. The portable pass creates AppImage and Snap packages with the validated runtime. The Flatpak pass remains isolated so targets from different runtime profiles cannot mix. Non-x64 Linux DEB outputs are marker-only packages and do not claim embedded frame-copy support.
References: electron-builder.json• L60-177 .github/…/build-and-make.yaml• L856-1045 .github/…/build-and-make.yaml• L1059-1087 .github/…/build-and-make.yaml• L1534-1574 tools/…/configure-linux-frame-copy-build.test.mjs• L43-145 tools/…/electron-package-identity.test.mjs• L153-341 tools/…/electron-package-identity.test.mjs• L551-567 tools/…/build-workflow-scope.test.mjs• L17-78
Android TV shell packaging
The Android TV shell packages the PWA inside a native shell for Fire TV and Android TV. The workflow builds the same PWA configuration used by Docker, bundles it with the shell, checks remote-control journeys against local services, and then runs Android backend and APK checks.
The workflow runs on changes to the shell, its workflow, or the package manager inputs that can change its parser. It regenerates M3U parser fixtures and fails when the committed Java fixtures differ from the parser shipped by the PWA. It produces a release APK and its FFmpeg source archive as workflow artifacts. A manual run can publish them as a GitHub release, with pre-release and Latest behavior controlled by the dispatch input. The IPTVnator repository keeps this release as a pre-release so it cannot interfere with desktop updater metadata or website download resolution.
References: .github/…/build-tv-shell-apk.yml• L1-42 .github/…/build-tv-shell-apk.yml• L63-117 .github/…/build-tv-shell-apk.yml• L163-217 .github/…/build-tv-shell-apk.yml• L228-263
Embedded MPV runtime
Embedded MPV supplies a native playback path for desktop packages. Its Linux design keeps MPV outside Electron: native addons and the frame reader do not load libmpv, while a separate helper owns that link. If the helper or runtime is not usable, the app keeps the native-view fallback instead of weakening the process boundary.
Runtime sources and staging
Linux builds create a pinned LGPL-compatible runtime from recorded source packages. The build records the source revisions, library set, ABI limits, dependency closure, build host, and license data. macOS builds stage a matching runtime for each CPU type and apply verified upstream MPV fixes that are not yet present in the pinned source. Windows uses an external archive whose SHA-256 value must match a checked-in pin before staging.
The Linux build creates a source compliance archive for the exact repository revision. It contains the source inputs, notices, build tools, and source identity needed to relate the shipped runtime to its source. CI caches the immutable inputs, then regenerates notices and the compliance archive for each package run. The final runtime manifest binds bundled x64 Linux packages to that archive and checks the archive's source snapshot against the pinned runtime.
The Windows pin identifies a stable upstream release, its x64 development archive, the MPV commit, and the upstream build run. Staging accepts the required headers, import library, and DLL layout. The record checks the archive hash and layout, but it is not a full certification of the upstream binary's transitive license closure.
The macOS patch step fails closed when a patch changes, is already in the pinned source, does not apply, or cannot be verified after application. Applied patch records become part of the runtime manifest.
References: tools/…/build-linux-runtime.mjs• L215-318 tools/…/build-linux-runtime.mjs• L601-764 tools/…/stage-runtime.mjs• L481-560 tools/…/stage-windows-runtime-archive.mjs• L319-377 tools/…/windows-runtime-pin.mjs• L45-151 tools/…/windows-runtime-pin.json• L1-17 tools/…/macos-source-patches.mjs• L6-24 tools/…/macos-source-patches.test.mjs• L266-334 .github/…/build-and-make.yaml• L154-455 .github/…/build-and-make.yaml• L275-455 tools/…/README.md• L6-25 tools/…/README.md• L335-398
Windows runtime pin refresh
The Windows runtime pin is refreshed by a scheduled or manual workflow. The updater checks whether the current asset is available and whether it has reached the 14-day refresh threshold. It selects the newest suitable stable release and checks for one matching asset, a GitHub checksum, and evidence for its MPV source and build run.
When the pin changes, the workflow validates the record and opens or updates one bot pull request. That pull request can start the normal CI path, so the new binary must pass the same packaging checks before release. The workflow runs only in the canonical repository and uses one serialized refresh group. Refresh tests use a synthetic pin age so they test the age rule without depending on the checked-in record's publication date.
References: tools/…/update-windows-runtime-pin.mjs• L15-18 tools/…/update-windows-runtime-pin.mjs• L58-116 tools/…/update-windows-runtime-pin.mjs• L138-182 .github/…/refresh-windows-embedded-mpv-runtime.yaml• L1-108 tools/…/windows-runtime-pin.test.mjs• L68-116
Runtime modes
Linux packaging has three frame-copy profiles. A system package uses the host distribution's MPV libraries. Portable and Flatpak packages carry the validated runtime with the application. Linux frame-copy release artifacts are x64-only. Other Linux architectures use marker-only packages and the process-isolated native-view fallback.
The packaged runtime manifest states the selected mode, native artifacts, fallback path, and runtime identity. Later checks use this record to compare package contents with the build that produced them.
References: tools/…/README.md• L175-201 tools/…/README.md• L259-267 tools/…/configure-linux-frame-copy-build.test.mjs• L43-145 tools/…/embedded-mpv-frame-copy-files.cjs• L383-543 tools/…/embedded-mpv-packaging.cjs• L762-773
Runtime package validation
Package validation checks product identity, worker files, native module placement, dependency closure, launcher behavior, and the embedded MPV contract. It rejects native MPV payloads inside app.asar, which keeps them in the unpacked area owned by packaging. Linux checks also confirm that the package target agrees with the selected runtime mode. Optional bundled connectors must also remain outside the application archive and carry the pinned asset record.
Artifact checks run in target environments. They inspect Linux package payloads, probe Snap and Flatpak runtime behavior, exercise the packaged x64 frame-copy and fallback paths, and check signed macOS bundles. The Snap and Flatpak probes run through the packaged application boundary so sandbox behavior and the missing-provider fallback are tested together with the native runtime.
References: tools/…/verify-electron-package-layout.mjs• L591-682 tools/…/verify-electron-package-layout.mjs• L697-810 tools/…/electron-after-pack.cjs• L247-275 .github/…/build-and-make.yaml• L1059-1450 tools/…/electron-package-identity.test.mjs• L569-734 tools/…/electron-package-identity.test.mjs• L736-866 tools/…/README.md• L294-333
Runtime security checks
Packaging tests also protect the minimum Node security level used by development, Electron, Docker, and GitHub Actions. The check compares the repository and Electron runtimes with the current security floors, requires Docker to use the repository Node version, and requires workflow Node setup to read .nvmrc.
The same test keeps the web backend alive when it receives a compressed JSON frame with trailing data. The packaging Nx target runs this check with the other packaging and embedded-MPV contract tests, so a runtime security regression blocks the packaging test target before release assembly.
References: tools/…/runtime-security.test.mjs• L18-68 tools/…/runtime-security.test.mjs• L70-141 tools/…/project.json• L7-75 tools/…/project.json• L1-15
Release safeguards
Release safeguards prevent a build from becoming a public asset when its contents, source link, or release state do not match the intended commit. The system treats a release as a set of related artifacts rather than as one installer file.
Draft release lifecycle
The build workflow creates one rolling draft for a pull request or branch. It names the draft with the version, source commit, and build context. Before upload, it removes old draft assets so a version change cannot leave stale installers beside the new set. Closing a pull request cancels remaining build work and removes its draft. A live state check prevents a late build from recreating a closed pull request's draft.
The build now separates the Linux runtime prerequisite from the macOS and Windows matrix. The release job waits for both the cross-platform and Linux profile matrices, then assembles their artifacts and the Linux source archive as one release set. A website-only pull request checks the AppStream assets without starting Electron packaging. A missing or uncertain scope result keeps packaging enabled. Version-tag pushes still run release builds.
Tagged builds use the release version and authored public release notes. The final release job waits for all platform build jobs, gathers their artifacts, merges platform updater metadata when needed, and creates the final asset set.
References: .github/…/build-and-make.yaml• L1-21 .github/…/build-and-make.yaml• L87-152 .github/…/build-and-make.yaml• L457-475 .github/…/build-and-make.yaml• L1534-1593 .github/…/build-and-make.yaml• L1784-1867 .github/…/cleanup-pr-draft.yml• L35-92 tools/…/build-workflow-scope.test.mjs• L80-195
Nightly channel
The nightly channel gives master builds a separate prerelease stream for users who choose the desktop app's Nightly update channel. The workflow resolves one compatible nightly version before the platform matrix starts, then applies that version and the nightly updater channel to every package in the run.
The version uses the current stable package version, the commit date, and the workflow run number. It stays above an existing stable release but below an untagged next release when that next version is already committed. This ordering lets stable users move to Nightly and lets the next stable release replace the nightly build later.
The release job requires all nightly updater files before it publishes a draft prerelease to 4gray/iptvnator-nightly. It skips an older run when a newer nightly exists and keeps the newest 20 nightly releases. A missing publish token skips publication without failing the build.
This diagram shows how one master push becomes a consistent nightly release or a controlled skip.
flowchart LR
A[Master push] --> B[Resolve one nightly version]
B --> C[Apply version and updater channel]
C --> D[Build platform packages]
D --> E{Required channel files present?}
E -- No --> F[Stop publication]
E -- Yes --> G{Publish token available?}
G -- No --> H[Skip nightly release]
G -- Yes --> I[Create draft in nightly repository]
I --> J[Upload assets and publish prerelease]
J --> K[Keep newest nightly releases]
References: tools/…/nightly-version.mjs• L1-47 tools/…/nightly-version.mjs• L67-143 tools/…/nightly-version.mjs• L221-297 .github/…/build-and-make.yaml• L17-23 .github/…/build-and-make.yaml• L52-82 .github/…/build-and-make.yaml• L490-505 .github/…/build-and-make.yaml• L1924-1946
Release notes and announcements
The release-note system turns one short .changes/*.md note per user-visible change into the public GitHub release body, the changelog section, the website release scaffold, and compact announcement drafts. Notes use a checked schema with a change type, area, body, optional issue links, and optional highlight or screenshot data. Internal notes stay in the changelog but do not enter public release surfaces.
The renderers keep one order for breaking changes, features, fixes, and performance work. Highlights lead social posts, while other changes form a compact list or count. Telegram and Reddit drafts enforce their own size limits. The tools write drafts only. Publishing remains a human action.
On pull requests, CI validates the note format and checks the changed-file and label policy before the change can pass. A newly added top-level note is required for user-visible runtime changes in apps/ and libs/; modified, renamed, nested, or README files do not satisfy that gate. Tests, website, mock-server, shared testing, snapshot, and documentation changes are excluded, and the approved escape label remains available.
References: tools/…/release-notes.mjs• L17-48 tools/…/release-notes.mjs• L151-187 tools/…/release-notes-render.mjs• L109-164 tools/…/release-announcements.mjs• L1-15 tools/…/release-announcements.mjs• L91-137 tools/…/release-announcements.mjs• L205-289 tools/…/release-notes-blog.mjs• L32-89 tools/…/release-notes-blog.mjs• L134-196 tools/…/release-notes-blog.mjs• L334-396 .github/…/ci.yml• L45-86 tools/…/release-note-gate.test.mjs• L17-143
Release screenshot capture
Release screenshots provide controlled product images for release posts and evergreen guides. The manifest defines the shot name, setup action, group, theme, viewport, and optional browser view. The capture tool turns those entries into dark and light images from a built app and local mock services. Setup actions cover core screens and guide states such as playlist setup, remote control, EPG mapping, download management, and offline playback.
The capture run is fail-closed. It uses an isolated app data directory, blocks external requests, checks frames for external resources and credential text, keeps TMDB disabled, and compares the user database before and after the run. A full run replaces the selected output set. A filtered run merges its subset without deleting other images. A shot change must remain valid in the manifest, the action registry, and the local fixtures that provide its data.
References: tools/…/capture-release-screenshots.ts• L1-28 tools/…/capture-release-screenshots.ts• L90-147 tools/…/capture-release-screenshots.ts• L151-347 tools/…/capture-app-driver.ts• L49-212 tools/…/capture-app-driver.ts• L229-353 tools/…/capture-fixtures.ts• L18-67 tools/…/capture-navigation-setup-actions.ts• L32-143 tools/…/capture-navigation-setup-actions.ts• L149-355 tools/…/screenshots.manifest.json• L1-18 tools/…/screenshots.manifest.json• L112-173
Snap release boundary
The Snap workflow runs after a public version-tagged release. It selects the exact Snap files and Linux source archive from GitHub, downloads only that set, validates their checksums and source correspondence, and writes a receipt tied to the released repository revision.
The receiving job checks the receipt, file sizes, hashes, names, and file types again before it publishes to the edge channel. Verification uses a fresh runner without Store credentials. Only the final upload step receives that credential. Promotion to candidate or stable remains a manual action after installed-Snap smoke checks.
References: .github/…/publish-snap.yaml• L11-18 .github/…/publish-snap.yaml• L40-129 .github/…/publish-snap.yaml• L133-269 tools/…/release-snap-assets.cjs• L473-591 tools/…/snap-workflow-policy.test-helpers.mjs• L4-26 tools/…/snap-workflow-policy.test-helpers.mjs• L401-547
Test and coverage automation
The automation system combines fast checks for every change with platform and user-flow checks for the areas that need them. It separates source coverage from semantic end-to-end coverage so a percentage score does not stand in for a real product journey. CI also checks build contracts, measures the production web payload, and runs performance journeys when a change can affect them.
Packaging and embedded-MPV contract tests run as one cached Nx packaging test target. Its inputs include the package profiles, release workflows, runtime tools, relevant Electron build files, and the macOS source patch registry and patch files. Changes to those contracts invalidate the test result. The target also includes workflow-scope checks and the runtime security check described above.
Unit coverage tiers
The coverage policy classifies projects into three tiers. Tier A projects produce source coverage and contribute to the merged baseline. Tier B projects run a focused validation command without joining the source percentage baseline. Tier C projects rely on another check, such as an end-to-end flow, or contain no runtime code that percentage coverage would measure well. Every Nx project with a test target has an explicit tier.
The Tier A process removes old reports, orders projects from largest to smallest, runs a bounded pool of projects with bounded Jest workers, rejects missing or unusable instrumentation, merges valid reports, and checks aggregate and critical-file thresholds. A first failure stops new projects while already-running projects finish so their logs and reports remain complete.
Pull requests skip the Tier A suite only when every changed path is outside known Tier A inputs. The scope rule uses a tested allowlist rather than nx affected, so an unknown file or a declared workspace input runs the suite. A package.json change is skippable only when the caller proves that it changes no dependency or coverage script. Master runs the full suite. Before any parallel coverage work that can execute Electron, CI and the runner prefetch and run the Electron binary once. Pull requests restore but do not write the protected transform cache.
References: tools/…/coverage-policy.json• L1-20 tools/…/coverage-policy.json• L46-63 tools/…/coverage-run-pool.mjs• L32-139 tools/…/run-tier-a-coverage.mjs• L42-245 tools/…/unit-coverage-scope.mjs• L1-223 .github/…/ci.yml• L591-706
Local pull request checks
The local pull request check gives an engineer the same high-risk signals before opening a pull request. It checks performance baseline direction, builds the production web app, checks initial bytes, and then runs coverage only when the changed paths can reach Tier A tests.
When coverage runs, the check reports uncovered lines and branches on changed files before it runs the final coverage health check. It treats a clean worktree and the selected commit as part of the check, so its report describes the code that the engineer reviewed. The --allow-increase option makes an intentional performance-baseline weakening visible; it does not hide the change.
References: tools/…/check-before-pr.mjs• L12-169 tools/…/check-before-pr.test.mjs• L111-173
Localization drift
Localization checks keep every translated locale aligned with the English message tree. They reject missing or extra keys, missing keys used by the renderer, and new non-empty values that are identical to English unless a reviewed baseline permits them.
The normal CI check reports a clean baseline state. A separate command rewrites the sorted baseline after locale files are complete. A duplicate-string report also finds English text that appears under several keys but has different translations in one locale. That report helps maintain consistent wording, but it is not a CI gate because context can require different grammar.
References: tools/…/README.md• L46-89 tools/…/check-drift.mjs• L175-331 tools/…/check-usage.mjs• L208-283 tools/…/check-duplicates.mjs• L20-61 tools/…/check-duplicates.mjs• L86-140 tools/…/identical-en-baseline.json• L1-48 .github/…/ci.yml• L517-523
Build contract checks
Build contract checks catch failures that can pass type checks but break the tools that assemble or render the product. They keep styles valid, preserve keyboard focus, keep icons tied to the shipped font, keep theme reads tied to declared tokens, keep form defaults local to lazy features, and keep Playwright targets runnable in local and CI environments.
The checks cover these contracts:
- The Material token guard rejects retired
--mdc-*names. - The font-weight guard keeps shipped UI weights on the supported scale.
- The focus guard keeps a global
:focus-visiblefallback and uses the app focus-ring token for component indicators. - The icon checks reject unknown Material ligatures and icon-only buttons without an accessible name.
- The theme checks reject undeclared custom-property reads and OS-only color-scheme rules outside the settings resolver. They also keep the Material theme scope aligned with the components the app imports.
- The form-field check keeps defaults with the lazy components that use them instead of loading those defaults at startup.
- The Playwright task-graph guard checks inferred end-to-end targets under both local and CI rules.
Lint also keeps the generated max-lines baseline from growing. The enforced limits and the file classes used to build that baseline come from one shared configuration, so a limit change cannot silently leave the baseline generator and lint rule out of sync. The generated list only shrinks; a new file must meet the limit or carry a deliberate file-wide exception. These checks run in the unit-and-typecheck workflow before the broader test work.
References: tools/…/check-material-token-overrides.mjs• L6-25 tools/…/check-focus-visible.mjs• L8-16 tools/…/check-theme-references.mjs• L6-15 tools/…/check-e2e-task-graphs.mjs• L6-20 tools/…/max-lines-config.mjs• L1-48 tools/…/validate-repository-skills.mjs• L129-259 .github/…/ci.yml• L449-569
Coverage integrity
Coverage integrity checks that reports describe the runtime-owning source files that they claim to cover. It normalizes paths, detects duplicate entries, rejects malformed Istanbul data, and requires usable instrumentation. The health check compares the merged summary with the computed report and applies aggregate and critical-file ratchets.
CI stores merged unit reports as an artifact and sends them to Codecov as a non-blocking upload. Reviewers can therefore inspect a report when the external service is unavailable, while local completeness and threshold checks still protect the build.
References: tools/…/coverage-integrity.mjs• L210-432 tools/…/coverage-health.mjs• L126-231 .github/…/ci.yml• L617-706
Performance safeguards
Performance safeguards use the production web build and a small set of Electron journeys to catch payload growth and changes in key user paths. The initial-byte check follows the built page's same-origin startup resources and the static imports of its startup modules, then compares their total with a committed baseline. Missing build files fail instead of looking like a smaller payload.
The shared performance action prepares the Electron runtime, runs the journeys under Xvfb, writes one summary, and reports the measurements in the job summary. The optional large-library journey uses a content-keyed profile cache and stays off pull requests because of its cost. CI sends the built renderer bundle to Codecov Bundle Analysis on trusted repository runs, but the initial-byte check remains the blocking payload safeguard.
The baseline direction check compares the target revision with the measured revision before the production build can hide a payload increase. It rejects raised limits, wider slack or tolerance, removed entries, counter values that move up, changes between counter and wall-clock entries, and changes to the automatic-tightening policy. A maintainer label can allow a deliberate increase, but the change remains visible in job output. Pull requests skip journeys only when their files cannot affect the app or its build inputs. Unknown paths remain relevant. Pushes to master and manual runs execute them.
The journey baseline file records counters validated against journey time and guard-only counters that protect stable behavior without claiming a time improvement. A baseline without a matching measurement fails, as does an empty selection, so a missing or renamed metric cannot disable the guard. CI selects every journey baseline except the initial-byte entry, which the separate web-build job checks. The weekly ratchet measures the same master commit on three runners and tightens an entry only when every run beats it.
This flow shows how CI chooses and runs the performance safeguards.
flowchart LR
A[Change] --> B[Build production web app]
B --> C[Check initial-byte baseline]
A --> D{Journey-relevant?}
D -- No on pull request --> E[Skip journeys]
D -- Yes or push/manual run --> F[Run Electron journeys]
F --> G[Check selected counters]
F --> H[Upload journey summary]
I[Baseline file] --> C
I --> G
References: .github/…/action.yml• L1-121 .github/…/ci.yml• L148-465 .github/…/performance-ratchet.yml• L1-246 tools/…/check-baseline-direction.mjs• L1-159 tools/…/check-journey-ratchet.mjs• L1-31 tools/…/journey-baselines.json• L1-178
Repository skill validation
Repository skill validation checks the shared instruction surfaces before unit coverage completes. It treats .agents/skills as the source of shared skills and checks each skill's front matter, size, required release skills, and literal repository references. It also requires matching .claude/skills directory links, so local Claude guidance cannot silently diverge from the shared source.
The validator returns all diagnostics in a stable order and keeps path checks inside the repository. Its tests cover malformed metadata, long skills, missing or escaping references, missing required skills, and copied or misdirected links. CI runs the validator as part of the unit-and-typecheck job.
References: tools/…/validate-repository-skills.mjs• L129-259 tools/…/validate-repository-skills.test.mjs• L103-339 .github/…/ci.yml• L449-450
End-to-end validation
End-to-end checks cover product journeys that unit coverage cannot prove. Electron runs on Linux, macOS, and Windows through a sharded matrix. Web checks run in Chromium and include production PWA update recovery. A separate Windows hosted-server smoke flow checks the deployed-style server path. The workflows retain Playwright reports and test results as artifacts.
CI calls the reusable E2E workflow only after fast validation and scope checks. Pull requests use three Linux shards, two macOS shards, and four Windows shards. Its summary job merges each operating system's shard reports into semantic coverage and fails when a shard report is missing or duplicated. Linux checks the display, Electron binary, and Electron runtime dependencies before the tests run. The Electron helper downloads and runs the binary before sharded work, which prevents concurrent extraction of a partial binary. Web checks install Chromium and run the browser flow. Pushes and manual runs remain available through the workflow's own triggers.
The same approach is used for packaged delivery. Linux portable packages run in their target environments, their runtime probes test missing-provider behavior, and the packaged frame-copy path is exercised with the native-view fallback available.
References: .github/…/e2e-tests.yaml• L1-30 .github/…/e2e-tests.yaml• L33-134 .github/…/e2e-tests.yaml• L136-177 .github/…/e2e-tests.yaml• L179-280 .github/…/ci.yml• L168-177 tools/…/ensure-electron-binary.mjs• L1-78
Docker delivery
The Docker image delivers the browser PWA and its Express web backend as one self-hosted service. A build stage creates platform-independent web assets and backend code. The runtime stage serves the PWA through nginx and proxies API requests to the internal backend.
The image installs the exact pnpm version declared by the project before it builds. Multi-architecture builds keep the web build on the native builder platform, then build the native SQLite dependency for each target platform. The result supports Linux AMD64 and ARM64 without running the heavy Node and Nx build through emulation.
At startup, the entrypoint writes the browser-facing backend URL, renders the proxy config, starts the backend, waits for its health endpoint, and then starts nginx. The container health check uses /api/health. If either process stops, the entrypoint exits so the container runtime can restart the service.
The image supports server storage on the /data volume and can keep the backend stateless when configured to do so. The browser PWA still has browser-local storage limits and does not provide Electron-only features such as Embedded MPV, the download manager, or desktop player control. EPG/XMLTV panels and multi-EPG views are also not available in the self-hosted PWA.
The self-hosted service can share source definitions between connected clients. Viewing activity and favorites use separate opt-in sync paths, while Recently Viewed, EPG data, and device settings stay local to each client. The default image contains both the PWA and its backend, so a separate legacy backend image is not needed.
The backend proxy accepts HTTP and HTTPS provider URLs and blocks private network targets by default. Enabling private-network access is intended only for trusted local or LAN deployments.
References: docker/Dockerfile• L1-29 docker/Dockerfile• L31-74 docker/docker-entrypoint.sh• L4-113 docker/nginx.conf• L1-34 docker/docker-compose.yml• L1-29 docker/README.md• L7-31 docker/README.md• L65-143 docker/README.md• L165-200
Image publishing
Pull requests build the image without publishing it. Trusted merges to master publish multi-architecture moving and commit-addressable PWA tags. Version tags publish release-aligned tags and add stable only for non-prerelease versions. Maintainers can request a manual push with a commit-addressable tag.
Use latest for the simplest self-hosted setup. Pin a commit-addressable tag for a reproducible deployment. Use release tags when the Docker image must track a tagged IPTVnator release.
References: .github/…/docker.yml• L3-35 .github/…/docker.yml• L47-123 docker/README.md• L65-86
GitHub workflow orchestration
GitHub Actions divides delivery into focused workflows. CI checks workflow syntax, release-note policy, performance baselines, repository skills, type and dependency rules, build contracts, localization drift, unit coverage, and tier validation. Its performance checks compare baseline files with the prior revision before measuring the production build, then check selected journey counters against their limits. Other workflows build desktop artifacts, check product journeys, publish Docker and website delivery, refresh the Windows MPV pin, publish Snap edge assets, and run CodeQL security analysis.
The packaging workflow has explicit planning boundaries. A website-only pull request checks its AppStream assets and does not start Electron packaging. The Linux runtime is built or restored once, then consumed by separate system, portable, and Flatpak jobs. macOS and Windows do not wait for that Linux runtime job. The final release job still requires every required matrix to succeed.
The PR scope script skips packaging only for known application-only inputs. It treats unknown files, build inputs, renames across the boundary, and an unavailable comparison as packaging-relevant. This fail-closed rule keeps a new build dependency from silently avoiding the package checks.
Concurrency rules cancel superseded pull request work but keep push, release, and nightly records from replacing one another in a queue. The CI and Electron E2E workflows use a unique run group for non-PR events, so a rapid master push does not replace a queued run. Artifact jobs pass verified outputs to later jobs. Permissions stay read-only unless a job must write a draft release, publish a page, upload security results, or refresh the Windows pin. The Windows refresh is serialized and limited to the canonical repository. Snap verification runs without Store credentials before a fresh runner performs the edge upload.
| Workflow | Main responsibility | Important hand-off |
|---|---|---|
| ci.yml | Workflow lint, release-note policy, performance safeguards, skill validation, type and dependency checks, localization and style checks, unit coverage, and tier validation | Coverage and performance artifacts plus check results |
| performance-ratchet.yml | Measure master on three runners and propose stricter performance baselines | Evidence-backed performance pull request |
| build-and-make.yaml | Cross-platform Electron builds, embedded MPV preparation, release assembly, and nightly publication | Platform artifacts, source compliance archive, or nightly prerelease |
| build-tv-shell-apk.yml | Build the PWA-backed Android TV shell and validate its APK inputs | APK and FFmpeg source artifacts or an optional pre-release |
| refresh-windows-embedded-mpv-runtime.yaml | Check upstream Windows runtime age and availability | Validated pin update pull request |
| e2e-tests.yaml | Electron and web user-flow checks | Playwright reports and semantic coverage summary |
| docker.yml | PWA image build and trusted publication | Docker Hub tags |
| deploy-website.yml | Website build and GitHub Pages deployment | Pages artifact |
| publish-snap.yaml | Public-release Snap verification and edge upload | Verified asset transfer and receipt |
| codeql-analysis.yml | JavaScript security analysis for changes and scheduled scans | SARIF result in GitHub code scanning |
References: .github/…/action.yml• L1-121 .github/…/ci.yml• L1-20 .github/…/ci.yml• L168-177 .github/…/ci.yml• L287-417 .github/…/build-and-make.yaml• L87-170 .github/…/build-and-make.yaml• L1511-1593 .github/…/build-tv-shell-apk.yml• L38-263 .github/…/docker.yml• L1-123 .github/…/deploy-website.yml• L1-62 .github/…/codeql-analysis.yml• L8-69 tools/…/pr-build-scope.mjs• L4-67 tools/…/build-workflow-scope.test.mjs• L80-195 tools/…/project.json• L7-75
Change checklist
When these files or sections are changed, remember to consider these:
- Update the Electron artifact selection in build-and-make.yaml when a target name, architecture, or package profile changes. The upload, verification, and draft-release file lists must continue to describe the same asset set.
- Keep the embedded MPV runtime manifest, staged files, package profile, source compliance archive, and release source binding aligned.
- Keep the macOS MPV patch registry, patch file hashes, source application step, runtime manifest, cache inputs, and packaging test target aligned. Remove a patch only when the pinned source contains its upstream change.
- Keep the Windows runtime pin schema, upstream asset naming rule, checksum, staging layout, and refresh pull request flow aligned.
- Keep the Cloudflare release version, source commit, license hash, per-platform asset map, packaged filename, and opt-in after-pack flag aligned. A new upstream asset must update both its digest and its source record.
- Keep
.nvmrc, Electron's embedded Node runtime, Docker'sNODE_VERSION, and every workflowsetup-nodestep on a patched and consistent Node release. The packaging runtime security test must continue to cover the same boundary. - Keep the website-only scope test, AppStream screenshot list, packaging job conditions, and final release dependencies aligned. A diff that cannot be trusted must continue to select packaging.
- Keep the Linux runtime cache inputs separate from generated notices and the compliance archive. Recreate the source archive and its repository binding for every release revision.
- Keep the three Linux profiles, foreign-architecture marker-only DEBs, artifact names, package verification environments, and release upload globs aligned.
- Keep the TV-shell workflow triggers, PWA build configuration, parser fixtures, backend checks, APK signing inputs, artifact names, and release pre-release rule aligned.
- When adding an Nx project with a test target, classify it in coverage-policy.json and choose whether it belongs in source coverage or another validation tier.
- Keep the Electron prefetch target and all references aligned after moving Electron helpers under
tools/testing/electron/. Parallel tests must not race during binary extraction. - When changing coverage scheduling, keep project ordering, pool limits, per-project worker limits, fail-fast behavior, buffered output, and coverage report paths aligned.
- Keep the local
pr:checksequence, patch-coverage report paths, clean-worktree rule, baseline comparison, and CI scope decision aligned. A local report must describe the same commit and the same changed-path policy as CI. - When changing locale keys or English text, keep every locale key set aligned. Review English-identical values before adding them to identical-en-baseline.json. Check renderer references and inspect duplicate-string reports.
- When changing styles, preserve the current Material token path, supported font scale, focus fallback, app focus-ring token, shipped icon names, declared theme tokens, form-field loading boundary, and Material theme scope.
- When changing Playwright project configuration or spec files, preserve task inference in both local and CI environments.
- When changing lint line limits or test-file classification, update max-lines-config.mjs and the generated baseline together. Keep the enforced rule and baseline generator on the same source of truth. The baseline list must not grow.
- When changing the production web build or journey files, keep the scope filter, prior-revision baseline comparison, startup resource and static-import measurement, baseline direction check, validated versus guard-only entries, runner evidence, selected counter list, summary output, artifact paths, and journey-ratchet contract tests aligned.
- When changing the shared performance action, keep Electron preflight, large-library cache inputs, one-summary discovery, job-summary output, and the CI counter selection aligned.
- When changing web startup dependencies, keep the initial-byte baseline tied to the prior revision and record measurement evidence before lowering or raising its limit. A missing emitted startup file must remain a failure.
- When changing Docker build inputs, keep the native build-platform boundary, exact pnpm selection, lockfile install, and target architecture behavior aligned.
- When changing Docker startup paths, ports, storage, or proxy settings, update the entrypoint, nginx template, image health check, compose health check, browser runtime configuration, and data-volume guidance together.
- When changing website build inputs or Pages deployment triggers, keep the Pages artifact path, deployment environment, and shared deployment concurrency aligned.
- When changing release concurrency or draft tags, preserve the link between live pull request state, the rolling draft, and cleanup workflow. Keep pull request cancellation separate from unique push and release groups.
- When changing the nightly version or updater channel, keep version ordering, matrix jobs, channel metadata, nightly publication, and the newer-release guard aligned.
- When changing Snap release verification or publishing, update the workflow, receipt and asset-transfer contract, and policy helpers together. Keep Store credentials limited to the final edge upload.
- When changing CI or E2E triggers, shard counts, or report paths, keep path filters, concurrency groups, runtime checks, summary inputs, and artifact names aligned.
- When changing release-note policy or CI validation steps, keep the changed-file and label inputs, dependency-free validation path, and release-note renderer contract aligned. Keep the gate's definition of a newly added top-level note aligned with note loading.
- When changing performance measurement or tightening, keep the prior-revision comparison, three-run evidence, baseline direction check, bot branch lease, PR label, evidence links, baseline metadata, and CI
--onlylist aligned. - When changing repository skill metadata, path rules, required skills, or Claude links, keep the shared source directory, front-matter rules, repository containment checks, symlink targets, and CI command aligned.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A website-only build omits or empties an AppStream screenshot | The website can pass while its release metadata points to unusable product imagery | The dedicated scope job and the Linux packaging job share a fail-closed screenshot check |
A native MPV file is placed inside app.asar | The packaged app may not load the native runtime from its required unpacked location | Package-layout validation rejects embedded MPV archive entries |
| A Linux package ships a runtime mode or architecture that does not match its profile | Playback falls back incorrectly or an unsupported frame-copy path is advertised | Runtime manifests, profile checks, marker-only rules, and artifact probes validate the mode and target |
| An opt-in Cloudflare bundle uses an unpinned or wrong platform asset | The installer can ship an unexpected connector or fail on a target platform | The bundle map pins the asset and license digests, and the after-pack stage fails on a mismatch |
| A parser changes without refreshed TV-shell fixtures | The Android TV backend can accept behavior different from the PWA parser | The TV-shell workflow regenerates fixtures and fails on a diff |
A TV-shell release is marked Latest in the main repository | Desktop update and website download logic can select an APK release without desktop updater metadata | The workflow defaults to a pre-release with Latest disabled |
| A Windows runtime pin points to a missing or changed upstream asset | The Windows package cannot obtain the native playback files or may use an unreviewed binary | Pin schema checks, availability checks, and SHA-256 validation stop the refresh or build |
| A runtime archive or source archive does not match its recorded hash | Release binaries may not correspond to the reviewed source or selected asset | SHA-256 checks and source-archive binding checks stop the build or Snap transfer |
| Package identity or updater metadata diverges from the root product | The installer can expose the wrong app identity or fail to offer expected update files | Identity tests compare builder metadata, associations, updater files, and upload rules |
| The repository, Electron, Docker, or workflow Node version falls below the security floor | A released build or CI job can run a runtime with known security flaws | Runtime security tests check Node floors, Docker selection, and workflow setup-node usage |
| Electron tests start while another process extracts the binary | Parallel tests can fail with a partial executable or a locked file | The Electron helper downloads and runs the binary before parallel coverage and journey work |
| Express stops after a valid compressed frame has trailing bytes | The web backend can terminate while handling a provider or API request | The isolated runtime security test sends the boundary payload and checks the process and health endpoint |
| A release note uses an unknown field or exceeds a surface limit | Release generation or an announcement draft fails | Note validation and surface-length guards reject the input |
| A user-visible pull request has no newly added top-level release note | The pull request fails the release-note gate even when its code is valid | CI reads changed files and current labels before applying the tested note policy |
| A screenshot run reaches the real user database or an external request | A release image can change user data or contain network-dependent or private content | Isolated data, blocked network access, frame checks, and database comparison fail the run |
| A locale has a missing or extra key, a missing used key, or an unapproved English-identical value | The translation set is incomplete or the UI shows a raw key | Drift, usage, and reviewed-baseline checks fail the CI validation |
| A Material icon name is not in the shipped font | The UI renders the name as plain text inside the icon box | The icon-ligature guard compares static names with the font map |
| An icon-only button has only a tooltip | Assistive technology cannot identify the control | The button-name guard requires an ARIA label or labelled-by relation |
| A focus rule removes the global outline or uses an unrelated ring color | Keyboard users lose a focus signal or receive a weaker visual indicator | Focus-visible and focus-ring guards scan global and component styles |
A style reads an undeclared token or follows prefers-color-scheme directly | The style falls back or ignores the app's selected theme | The theme-reference guard checks declarations and color-scheme queries |
| A lazy Material feature loads root form-field defaults or a new Material import lacks theme scope | Startup work grows or the feature renders without the app theme | Form-field and Material-theme scope guards check the loading and theme boundaries |
| A performance baseline is raised, widened, removed, changes type, or changes tightening policy without the required decision | Payload growth or a weaker performance guard can pass unnoticed | The direction check compares the target revision with the head revision and requires the maintainer exception for deliberate increases |
| A relevant performance change is hidden by the CI scope filter | The journey job can skip a measurement that should have run | Unknown paths remain relevant, and pushes and manual runs always execute journeys |
| A built startup resource or static import is missing | The initial-byte check could report a false payload reduction | The measurement fails on missing index.html, referenced files, or startup imports |
| A journey summary is missing, has no selected measurement, or places a value in the wrong section | A stable user-path regression can pass despite a successful journey run | The shared action requires one summary, and the ratchet rejects missing or misplaced baseline measurements |
| A Playwright target graph is valid in one environment but not the other | Local runs or CI can fail before end-to-end tests start | The graph check validates inferred targets with both local and CI settings |
| A rolling draft keeps assets from an older version | Users or release tooling can see a mixed installer set | Draft asset pruning removes the old set before upload |
| A shared CI group replaces a queued non-PR run | A master push can be left without a lint, test, or performance record | Non-PR groups use the unique workflow run ID, while pull request runs cancel in progress |
| The Docker backend does not become healthy | nginx can serve a page while API calls fail, or the service can restart in a bad state | The entrypoint waits for /health, and the image and compose checks use /api/health |
| Private-network proxy access is enabled on a public instance | The backend can be used to reach trusted network targets | Private targets are blocked by default and the setting is limited to trusted deployments |
| The Docker data volume is absent or not backed up | Server-side backend data can be lost or the deployment cannot keep state | Compose mounts /data, and deployment guidance treats the database and WAL file as persistent data |
| Snap workflow policy allows a wider action, shell, job, or Store-credential path | Release verification can run with a wider execution surface | Policy helpers enforce the trigger, job shape, action allowlist, isolated transfer, and final-step credential use |
| An Electron shard report is missing or duplicated | Semantic E2E coverage can look complete when one part did not run | The per-OS summary checks shard result cardinality before producing coverage |
Linux loses xvfb-run, a shared library, or the Electron binary | Electron E2E jobs fail later with unclear display or launch errors | The Linux preflight checks the display tool, binary download, executable path, and shared-library links |
| A performance ratchet run fails after writing a partial journey summary | The weekly tightener can use incomplete evidence for some entries | Missing measurements and unstable counters preserve the existing baseline, while three independent runs are required for tightening |
| A maintainer edits the automated performance PR branch | The next tightening run could overwrite review work or mix measurements | The workflow detects foreign commits and leaves the branch unchanged |
| A skill has invalid front matter, too many words, a missing required release skill, or a bad repository path | Agent guidance can fail validation or point to stale or unsafe material | The validator checks metadata, size, required skills, local literal paths, repository containment, and shared symlink targets |
Key files
| File | Why to read it |
|---|---|
| electron-builder.json | Defines product identity, package families, native-file handling, signing settings, and Linux sandbox settings. |
| .github/…/build-and-make.yaml | Shows the desktop build matrix, website scope check, embedded MPV preparation, Linux profiles, source compliance hand-off, nightly version hand-off, package checks, and release assembly. |
| tools/…/electron-after-pack.cjs | Connects final desktop packaging to native MPV validation, Linux profile rules, Snap setup, and optional connector bundling. |
| tools/…/cloudflared-bundle.cjs | Records the pinned connector assets, verifies downloads, and writes upstream license and source metadata. |
| .github/…/build-tv-shell-apk.yml | Shows the PWA-to-APK flow, parser fixture contract, Android checks, artifact hand-off, and guarded release behavior. |
| tools/…/pr-build-scope.mjs | Defines the fail-closed decision that selects or skips Electron packaging for a pull request. |
| tools/…/project.json | Connects packaging, workflow-scope, embedded-MPV, and runtime security tests to cached Nx targets and their relevant inputs. |
| tools/…/build-workflow-scope.test.mjs | Protects website-only packaging scope, AppStream assets, macOS ticket retry behavior, and rolling draft state checks. |
| tools/…/configure-linux-frame-copy-build.test.mjs | Explains the Linux profile mapping and marker-only foreign-architecture package contract. |
| tools/…/electron-package-identity.test.mjs | Locks package identity, updater metadata, playlist associations, native MPV boundaries, and Windows runtime contracts. |
| tools/…/verify-electron-package-layout.mjs | Defines final package boundary checks for identity, workers, dependencies, launchers, and native payload placement. |
| tools/…/runtime-security.test.mjs | Protects patched Node floors, consistent runtime selection, and Express behavior at a compressed-input boundary. |
| tools/…/README.md | States the embedded MPV process boundary, runtime policy, profile model, source distribution, and package probe rules. |
| tools/…/build-linux-runtime.mjs | Shows how the pinned Linux runtime becomes a recorded source and library set. |
| tools/…/macos-source-patches.mjs | Defines the verified upstream fixes applied to pinned macOS MPV sources before the runtime build. |
| tools/…/macos-source-patches.test.mjs | Protects patch hashes, application order, manifest recording, cache inputs, and packaging-target coverage. |
| tools/…/windows-runtime-pin.json | Records the exact upstream Windows runtime release and checksum used by packaging. |
| tools/…/update-windows-runtime-pin.mjs | Explains when the Windows pin refreshes and how a new upstream release is selected. |
| tools/…/release-snap-assets.cjs | Defines exact-asset, hash, receipt, and source-correspondence rules for Snap transfer. |
| tools/…/coverage-policy.json | Defines coverage tiers, semantic E2E tags, critical journeys, and coverage ratchets. |
| tools/…/unit-coverage-scope.mjs | Decides when a pull request can safely skip the full Tier A unit coverage suite. |
| tools/…/check-before-pr.mjs | Runs local baseline, payload, and changed-file coverage checks before a pull request. |
| tools/…/coverage-run-pool.mjs | Defines bounded parallel coverage scheduling and the Electron-binary detection used before concurrent tests. |
| tools/…/run-tier-a-coverage.mjs | Runs Tier A projects, validates each report, and preserves complete output after a failure. |
| tools/…/coverage-integrity.mjs | Explains the completeness rules that keep source coverage reports meaningful. |
| tools/…/ensure-electron-binary.mjs | Downloads, runs, and verifies the Electron binary before tests or journeys use it. |
| tools/…/cache-electron-release.mjs | Provides checksum-verified Electron release caching for CI. |
| tools/…/project.json | Exposes the Electron prefetch step as an Nx target used by packaging and test flows. |
| .github/…/action.yml | Shares Electron preflight, optional large-library setup, journey execution, summary discovery, and job reporting. |
| tools/…/journey-baselines.json | Records production payload and Electron journey limits, evidence, slack, and guard-only status. |
| tools/…/check-baseline-direction.mjs | Prevents performance limits, tolerance, slack, entry type, and tightening policy from weakening without a maintainer decision. |
| tools/…/check-journey-ratchet.mjs | Compares measured journey summaries with committed limits and rejects missing measurements. |
| tools/…/check-journey-ratchet.test.mjs | Protects the journey baseline schema, CI selection contract, and fail-closed comparison behavior. |
| tools/…/tighten-baselines.mjs | Safely lowers baselines from three-run evidence and records the evidence for review. |
| tools/…/project.json | Connects performance tool tests and lint checks to the Nx task graph. |
| docker/README.md | Explains Docker scope, tags, runtime settings, storage, proxy limits, client sync, and local validation. |
docker/Dockerfile | Shows the PWA image stages, exact package-manager setup, native dependency boundary, and health check. |
| docker/docker-entrypoint.sh | Shows runtime configuration, backend readiness, nginx startup, and process failure handling. |
| docker/docker-compose.yml | Shows the local deployment port, persistent data volume, storage mode, restart policy, and health check. |
| .github/…/ci.yml | Shows workflow concurrency, release-note gating, performance checks, style and accessibility checks, localization checks, unit coverage, and artifacts. |
| .github/…/e2e-tests.yaml | Shows the cross-platform Electron and web journey matrix, hosted-server smoke check, preflight checks, sharding, PWA update recovery, and retained reports. |
| .github/…/performance-ratchet.yml | Shows the three-run weekly measurement, safe baseline tightening, and evidence-backed pull request flow. |
| .github/…/docker.yml | Shows when Docker images are validated, published, and tagged. |
| .github/…/deploy-website.yml | Shows the website build trigger, Pages artifact, deployment environment, and concurrency. |
| .github/…/refresh-windows-embedded-mpv-runtime.yaml | Shows the scheduled and manual review flow for the Windows runtime pin. |
| tools/…/release-note-gate.test.mjs | Defines which changed-file states need a new release note and which labels or path classes exempt them. |