Files
Heimdall/skills/release-automation/SKILL.md
T
arnaud.dartois 7c0c8ecf46
Heimdall Gitea / Detect CI scope (push) Successful in 11s
Heimdall Gitea / Build and tests (push) Successful in 18m40s
Heimdall Gitea / Build and scan server image (push) Successful in 8m5s
Heimdall Gitea / Build and scan agent image (push) Successful in 12m52s
Heimdall Gitea / Build and scan NVIDIA Agent image (push) Successful in 28m19s
Heimdall Gitea / Publish versioned installer release (push) Successful in 4m43s
Heimdall Gitea / CI policy (push) Successful in 13s
[Install] Vérifier le checksum publié du bundle serveur (#328)
Co-authored-by: Arnaud Dartois <admin@tordais.cc>
2026-11-12 03:17:50 +01:00

8.1 KiB

name, description
name description
release-automation Build and validate changed Heimdall images on pushes, then publish versioned Docker Hub images and signed installer assets for semver tags.

Heimdall build and release workflow

For every PR, follow pull request release assessment. Determine and record whether a release is needed and the proposed SemVer from the change impact; do not ask the user to decide. Documentation and skills-only changes do not create a release or change the version. Only tag a release after the merged commit is on main and required checks pass.

For any local release investigation that needs credentials, follow Infisical secrets. Keep publication credentials in Gitea Actions as specified below; do not assume that a key in Infisical is available to CI.

Use this skill for changes to .gitea/workflows/build.yml, scripts/ci/change_scope.py, image build/push scripts, installer packages, release signing, or the Gitea release job.

Delivery contract

  • Pull requests run verify and build/scan only images affected by the changed project graph. They never receive Docker Hub or Gitea publication credentials.
  • test-plan.py computes both affected test suites and build targets from transitive ProjectReference edges. PRs build only those test projects and any changed source projects not covered by them; the solution is built only for main/tag runs or broad CI/build-configuration changes. The solution restore remains locked and solution-wide for the dependency security report.
  • A push to main validates the changed source and builds/scans/pushes only affected images. The affected image gets immutable sha-<full-sha> and mutable latest tags on Docker Hub. Main pushes do not create Gitea releases.
  • Runs for the same ref are serialized so a slower older main run cannot overwrite a newer latest image.
  • A MAJOR.MINOR.PATCH tag (optional prerelease suffix allowed) is a version release. It validates the complete source and builds/scans server, Agent CPU, and Agent GPU images once each. The verified images are pushed to Docker Hub as sha-<full-sha> and the application version.
  • After merge of a release-worthy PR, use the current stable tag and all unreleased changes to calculate the SemVer increment according to pr-release-versioning. Fetch main, verify the merged commit is reachable from it, verify the selected tag is unused, create an annotated tag at the merged commit, and push it to trigger this workflow. Never ask the user to choose a version or release, infer a version from the PR title alone, or force-update an existing tag. Documentation and skills-only changes do not get a tag.
  • The tag release job does not build or scan Docker images. It pulls the already scanned immutable image refs to verify their source revision, then resolves canonical digests from Docker Hub Registry v2 using the immutable commit tags. It creates a signed Gitea release containing heimdall-installers-<version>.zip, its heimdall-installers-<version>.zip.sha256 sidecar, framework-dependent Agent archives, the public key, signed update manifest, and CPU/GPU image digest manifests. Local Docker RepoDigests can contain multiple values and must not be used as a uniqueness check. Build provenance, image-digest bookkeeping, and unrelated checksums stay in CI package output and are not uploaded as end-user release assets. It never uploads Docker image archives to Gitea.
  • The package script uses fast gzip compression for the framework-dependent release archives to reduce release-job CPU time; keep the archive names and layout stable for Linux and Windows installers.
  • The installer ZIP preserves the install/ and docker/ layout consumed by the Linux and Windows server installers. The package job writes a checksum sidecar with the archive's exact asset filename. A raw-branch .sh or .ps1 bootstrap resolves Gitea's latest stable version (or an explicit HEIMDALL_INSTALLER_VERSION), uses a valid Gitea SHA-256 asset digest when present and otherwise downloads and parses the published sidecar, then verifies the ZIP before running its version-pinned script. A malformed non-null Gitea digest is a hard failure; it must not be silently replaced by the sidecar. Versioned bundle scripts pin their source assets and server image to the same tag and do not resolve a moving release. Direct Agent install scripts served by Central continue to download Agent payloads through Central's configured Gitea release API.
  • Gitea release creation is idempotent by version tag. A release remains draft until every expected asset is uploaded; stable versions publish as releases and versions with a prerelease suffix publish as prereleases.
  • Central stores only the public Forgejo origin in updates.forgepublicurl and constructs the canonical Heimdall releases/latest API route in code. Preserve the legacy setting migration and never make the derived API route editable in Settings.
  • The Site Install panel displays the configured signed release version and only exposes native install commands when the signed manifest, key, and platform assets are available. Docker commands also require a verified image digest.
  • Required publication secrets are DOCKERHUB_USERNAME, DOCKERHUB_TOKEN, and RELEASE_SIGNING_KEY_B64; RELEASE_SERVER_URL must match the HTTPS origin in BUILD_SERVER_URL. Do not create or use a long-lived RELEASE_TOKEN PAT. The tag-only publish job gets Gitea's built-in GITEA_TOKEN, scoped to contents: write and pull-requests: read; PR jobs retain read-only contents access and never receive publication credentials.
  • For the first signed release, when no Agent or signed manifest has been distributed, create one ECDSA P-256 key pair and save only the base64-encoded private PEM as the repository Actions secret RELEASE_SIGNING_KEY_B64. Keep an offline backup in an approved secret vault. The release publishes the derived public key, which becomes the trust root for new Agents; never rotate it after adoption without following the documented key-rotation procedure. Set RELEASE_SERVER_URL as an Actions variable to the exact HTTPS origin.

Image change scope

scripts/ci/change_scope.py maps changed paths to the exact Docker build graphs. Shared build configuration and shared Domain/Application/Contracts projects affect both Central and Agent. Web/Infrastructure/installer assets affect Central; Agent and mDNS projects plus the model affect Agent CPU and GPU; each Dockerfile affects only its own image. Keep this map aligned with the COPY instructions and project references in the Dockerfiles. A version tag deliberately selects every image.

Offline end-to-end acceptance

Run python3 scripts/ci/accept-release-offline.py from a clean dedicated worktree. It invokes package, release-note, and release scripts with disposable ECDSA P-256 credentials, a loopback-only TLS Gitea API double, synthetic pull request data, and a fake Docker CLI. It checks the version-pinned Linux/Windows installer ZIP and its published checksum sidecar, installer bootstrap with both a valid API digest and digest: null, Agent archive checksums, manifest signature, Docker Hub immutable refs/digests, the exact minimal release asset set, and proves the publication script does not build or scan images. The fake Docker CLI must never contact a registry; the API double must reject non-synthetic authorization and suppress request logging.

For build-scope changes, validate that documentation-only, Central-only, Agent-only, and shared-project file sets produce the intended image outputs. For behavior/deployment changes, also run the required disposable source-built Compose recipe with generated credentials, ports, project name, and unique local image tags. Its EXIT trap must verify project containers, volumes, and networks are gone and remove/verify absence of only its exact image tags.

These simulations do not prove Actions permissions, signing secret availability, runner network, Docker Hub/Gitea publication, Central production configuration, or native Agent hardware/OS behavior. Record actual remote evidence in the focused Gitea issue; do not mark it complete based on offline simulation.