Build, package, and release automation
The build and release system turns kURL source and component definitions into installer assets, add-on archives, host packages, test runs, and versioned public releases. Make targets provide the shared build contract, while GitHub Actions coordinate parallel builds, validation, storage, and release steps.
Build system
The build system assembles the inputs that an installer needs into a common set of files and distribution archives. Build metadata records the release tag, source commit, and build time so that produced binaries can be traced back to a source state.
The main build stages are:
- Prepare installer scripts and reusable tools.
- Collect manifests, add-ons, Kubernetes resources, and helper binaries.
- Create archives for common assets, add-ons, host packages, and Kubernetes packages.
- Publish selected archives to a staging or production location.
The Makefile is the shared contract for these stages. Its targets keep local builds and CI builds aligned. The kurl_util build provides helper binaries and the utility image used by common installer assets. Build initialization also prepares the SBOM tool and its signing inputs for release output.
Installer asset assembly
Installer asset assembly combines the shell entry points with their shared task code and turns them into templates. The resulting install, join, upgrade, and task assets carry release-specific values that a later installer build can fill in.
This assembly also gathers shared Kubernetes resources, Helm and Krew tools, custom resource definitions, and the kURL utility image into the common distribution archive. The result is a self-contained base for installer actions rather than a collection of source files that each consumer must assemble.
References: Makefile• L71-79 Makefile• L263-401 Makefile• L403-446 Makefile• L588-607 scripts/initialize-build.sh• L5-32 kurl_util/Makefile• L35-108
Package archive generation
Package archive generation converts each versioned add-on or package definition into a distributable archive. An archive keeps the component files together with the images, assets, and host-package data named by its manifest.
The package set includes add-ons, host packages, Kubernetes packages for supported operating systems, Kubernetes conformance data, and common installer assets. Host packages are gathered in OS-specific build environments so that an installer can use the right package form for the target host.
The OS matrix is part of this contract. A change to a supported OS or its package-building bundle must cause the related Kubernetes package to be rebuilt, even when the versioned package directory did not change. Installer preflights enforce the same supported-OS policy and also reject Kubernetes targets that are incompatible with the host OS or container runtime. The package matrix and runtime checks must stay aligned.
References: Makefile• L85-259 Makefile• L450-586 Makefile• L667-673 bin/save-manifest-assets.sh• L382-542 bin/list-all-packages.sh• L13-40 bin/list-all-packages.sh• L68-97 scripts/…/preflights.sh• L81-117 scripts/…/preflights.sh• L181-215 scripts/…/preflights.sh• L344-357
Add-on and package catalogs
The catalog system turns add-on definitions into the JSON data used to discover add-ons and their supported versions. It separates source definitions from generated catalog data so that the catalog can be refreshed as part of a release.
generate-addons.js reads add-on categories and version directories, applies the preferred version list used by installer selection, and adds the special Kubernetes and host-package entries. It writes the generated catalogs to the selected object-store folder under both the release version and the unversioned current path when the caller requests both.
Staging and candidate workflows refresh catalog data only after the package set is ready. A pull-request candidate writes versioned catalog data only, so it cannot advertise packages that are absent from the shared staging release.
References: bin/generate-addons.js• L5-16 bin/generate-addons.js• L39-131 .github/…/testgrid-pr.yaml• L522-557 Makefile• L741-743
Distribution artifact handling
Distribution handling moves archives through staging and production object-store paths. Each artifact has a versioned path for reproducible access and a current path for clients that follow the latest distribution. Package metadata carries a checksum and source identifier.
The package list is generated from the add-on and package trees. The list is split into batches so GitHub Actions can build many independent artifacts at the same time. A package with no relevant source change can be skipped or copied from an existing release instead of being rebuilt.
The staging path is also a release candidate. After all packages and catalogs are ready, the workflow writes the release identifier to VERSION, clears the staging cache, and starts the staging TestGrid run. Production later promotes the tested staging artifacts into the versioned production path.
Pull-request core validation uses a separate per-run staging path. The testgrid-pr workflow builds a unique release-candidate tag for a labeled or manually dispatched branch, rebuilds the core package batch, and copies the remaining packages from the current staging release. It writes only versioned candidate artifacts and catalog data. It does not change the shared staging VERSION, unversioned staging metadata, or production paths. The default run uses a reduced operating-system set; a testgrid-full label or manual input selects the full matrix. Each run also publishes a matching versioned utility-image tag so the installer can resolve the image used by that candidate.
The artifact movement is summarized below.
flowchart LR
Source[Source definitions] --> Matrix[Package batches]
Matrix --> Build[Build or reuse archive]
Build --> Stage[Staging object store]
Stage --> Validate[Staging TestGrid]
Validate --> Promote[Versioned production object store]
Promote --> Current[Current production paths]
Staging artifact flow
The staging workflow builds a release candidate from main. It first creates a commit-based version identifier and a matching utility image, then builds package batches in parallel. Small shared assets are always rebuilt, while other artifacts use source-path and stored-commit checks to avoid needless work.
The workflow publishes each archive under staging/<release> and under the staging current path. It also generates the add-on catalog and sets the staging VERSION only after those jobs complete. A full deployment TestGrid run then checks the candidate as an installer release.
References: .github/…/deploy-staging.yaml• L1-122 .github/…/deploy-staging.yaml• L124-222 bin/upload-dist-staging.sh• L22-59 bin/upload-dist-staging.sh• L119-181 bin/list-all-packages-actions-matrix.sh• L12-48
Pull-request core test flow
The pull-request core test workflow provides an opt-in check for changes that affect core scripts, packages, or staging metadata. A run-testgrid label or manual dispatch starts the flow. Fork pull requests are skipped because the flow must not expose credentials to untrusted code. A protected testgrid-pr environment with required reviewers gates the staging and registry credentials; the label is a trigger, not the security boundary.
The flow creates a per-PR or per-branch release-candidate tag. It always publishes a versioned utility-image tag, either by building a branch image or by retagging the existing utility image. It rebuilds the core installer assets and any manually selected extra packages, copies the rest from the prior staging release, and lets the fresh build write after the copy so stale packages cannot replace PR output. It generates catalog data only in the candidate path, patches each TestGrid spec entry that uses the empty installer version to use the candidate version and staging endpoint, and queues TestGrid against the candidate tag. The workflow can fetch its helper script from the workflow's own ref so a manual run can test an older branch that does not yet contain that helper.
The default run uses a smaller operating-system set. A testgrid-full label or a manual OS input selects a wider set. Newer runs for the same PR or branch cancel older runs. A pull-request run appends the queued run or a build failure to one sticky PR comment, while the TestGrid checker can use the queued-run marker to report later results. Direct job dependencies keep failures visible to the comment job instead of turning them into only a skipped downstream job.
The candidate remains isolated from shared staging and production. Its storage access is intended to read existing staging artifacts and write only under the candidate prefix, which limits the effect of running PR-authored build code. S3 candidate objects expire through staging cleanup, but the per-run utility-image tags in the shared Docker Hub repository do not currently have matching cleanup.
References: .github/…/testgrid-pr.yaml• L1-89 .github/…/testgrid-pr.yaml• L91-240 .github/…/testgrid-pr.yaml• L242-320 .github/…/testgrid-pr.yaml• L321-520 .github/…/testgrid-pr.yaml• L522-606 .github/…/testgrid-pr.yaml• L611-688 bin/testgrid-pr-kurl-util.sh• L3-25 bin/testgrid-pr-spec.sh• L12-40 bin/testgrid-pr-spec.sh• L41-118
Single-package rebuild flow
The single-package rebuild workflows repair or refresh one archive without rebuilding the full distribution. A staging rebuild uses the current source tree and a commit-based candidate version. A production rebuild checks out the latest release tag and writes the rebuilt archive to both its versioned release path and the current production path.
Both flows attach a checksum and source commit to the object, then purge the matching CDN paths. Repository dispatch starts the normal automated path, while manual dispatch accepts the package name for targeted recovery or maintenance.
References: .github/…/build-package-staging.yaml• L1-58 .github/…/build-package-prod.yaml• L1-63
Image vulnerability scan
The daily image scan checks the operating-system contents of the images named by the generated add-on matrix. It runs each image independently, keeps failures from one image from stopping the full scan, and collects failed results into one downloadable artifact.
The scan treats high-severity fixed vulnerabilities as failures for images marked for alerting. Other image failures remain visible in the collected report without blocking the scheduled scan.
The scan runs each day before the weekly release window. It sends the collected report to Slack on Mondays, while a manual run can request a report on another day. A report is not sent when no findings exist.
References: .github/…/cron-scan-images-daily.yaml• L1-15 .github/…/cron-scan-images-daily.yaml• L17-41 .github/…/cron-scan-images-daily.yaml• L43-77 .github/…/cron-scan-images-daily.yaml• L79-116
Production artifact flow
The production workflow starts when a valid date-based release tag is pushed. It builds the Go binary package set in parallel with locating the staging release made from the same commit, then waits for that release's TestGrid run to finish before promotion.
For promotion, production copies the tested staging archives into the versioned dist path. It also keeps the tagged Go package build as part of the release output. After both package paths complete, production updates the unversioned release marker and creates the GitHub release with its changelog and signed SBOM assets. It dispatches the documentation release-notes workflow after the current version marker is set, while release notification waits for the GitHub release.
The workflow then queues a final production TestGrid run after the current version is visible. This keeps production publication tied to a tested staging candidate while checking the promoted release in its production location.
References: .github/…/deploy-prod.yaml• L1-90 .github/…/deploy-prod.yaml• L92-187 .github/…/deploy-prod.yaml• L189-205 .github/…/deploy-prod.yaml• L214-318 .github/…/deploy-prod.yaml• L318-353 bin/upload-dist-versioned.sh• L98-157 bin/upload-dist-versioned.sh• L159-241 bin/list-packages-s3.sh• L21-30
Test matrix execution
The test automation checks both the build system and the behavior of released artifacts. Pull requests run source and shell checks, while add-on changes, image scans, and release workflows create focused matrix items for the affected component or platform.
The main test paths are:
| Scope | Trigger | Result |
|---|---|---|
| Source and build checks | Pull request | Go module, helper binary, shell, and generated-action checks |
| Add-on change checks | Add-on pull request | One or more TestGrid runs for each changed add-on version |
| Core release-candidate checks | Labeled or manually dispatched pull-request flow | TestGrid run against an isolated core candidate |
| Staging release check | Main deployment | Installer validation against the staged release |
| Production release check | Version promotion | Installer validation against the production release |
| Image security checks | Daily schedule or manual dispatch | Per-image vulnerability result and collected failure report |
| Compatibility check | Manual or called workflow | A real compatibility-matrix cluster is created and checked |
Add-on test matrix
Add-on pull-request testing first identifies changed version directories. It ignores templates, non-spec add-ons, removed versions, and add-ons without TestGrid templates. Each remaining add-on version becomes one matrix item because a TestGrid run does not support testing two add-on updates in one run.
The pull-request workflow runs only for repository-owned pull requests that do not use the skip label. It cancels an older run for the same pull request or branch when a newer run starts, and it limits concurrent add-on jobs so shared test resources remain controlled.
The reusable add-on workflow builds a temporary archive and submits every YAML test template for that add-on. The test runner supplies the version and package URL for the archive under test, then returns one message per matrix job as an artifact. The pull-request workflow combines those messages into one sticky pull-request comment. The add-on flow does not rewrite shared staging version metadata; each test uses an asset override for the package under test.
References: bin/addon-has-changes-matrix.sh• L21-57 bin/addon-has-changes-matrix.sh• L60-91 .github/…/test-addon-pr.yaml• L4-53 .github/…/test-addon-pr.yaml• L55-122 .github/…/test-addon.yaml• L36-90 bin/build-addon-package.sh• L12-33 bin/test-addon.sh• L12-54 .github/…/action.yml• L39-63
Release test matrix
Release validation uses the release identifier as the link between object-store artifacts and TestGrid. The staging workflow queues a deployment run after it sets the staging version. The production workflow first confirms that the matching staging release exists and that its TestGrid run has no pending instances, then copies those artifacts into production. After promotion it queues a separate production run against the current production version.
The core pull-request flow uses the same release-identifier model without entering the promotion path. It queues TestGrid against the isolated candidate tag and selected operating-system specification, then reports the run to the PR when the run is created.
The verification step treats a missing run, duplicate run, or unfinished instance set as a release failure. This prevents a tag from silently promoting an untested or incomplete candidate.
References: .github/…/deploy-staging.yaml• L144-204 .github/…/deploy-prod.yaml• L92-132 .github/…/deploy-prod.yaml• L160-187 .github/…/deploy-prod.yaml• L318-353 .github/…/testgrid-pr.yaml• L559-610 bin/verify-testgrid-run.sh• L21-59
Automated component refresh
The component update jobs turn scheduled or manual upstream checks into normal pull requests. Each job checks out the repository with full history, runs the generator for one add-on or package, and creates a pull request only when the source tree changes. The pull request includes the generated version in its title and release-note text, so review and release records remain part of the normal source flow.
Most update jobs run each Monday at 01:00 and also support manual dispatch. MinIO is manual-only. Prometheus, Rook, and Weave accept a requested version, while Rook also supports a force option. Some generators need Helm or Go before they can refresh their component. Kubernetes uses a package template and a GitHub token, and EKCO records its bundled HAProxy version with the update.
Each generated pull request targets main, uses an automated component branch, and carries component labels. The body also asks reviewers to check whether a kURL-api compatibility rule is needed. OpenEBS adds an auto-merge label, so its update has a different merge policy from the other component refreshes.
References: .github/…/update-cert-manager.yaml• L1-48 .github/…/update-containerd.yaml• L1-48 .github/…/update-contour.yaml• L1-48 .github/…/update-ekco.yaml• L1-49 .github/…/update-flannel.yaml• L1-49 .github/…/update-goldpinger.yaml• L1-58 .github/…/update-kubernetes.yaml• L1-50 .github/…/update-metrics-server.yaml• L1-49 .github/…/update-minio.yaml• L1-45 .github/…/update-openebs.yaml• L1-53 .github/…/update-prometheus.yaml• L1-68 .github/…/update-registry.yaml• L1-48 .github/…/update-rook.yaml• L1-64 .github/…/update-sonobuoy.yaml• L1-47 .github/…/update-velero.yaml• L1-47 .github/…/update-weave.yaml• L1-55
Versioned release publishing
Versioned release publishing begins with a controlled Git tag and ends with public artifacts, release notes, signed dependency data, and production validation. The date-based tag identifies the release and the numeric suffix allows more than one release on the same day.
The release command checks the branch, remote state, previous tag, and commit count before it asks for confirmation. The production workflow then checks that the tag uses the current UTC date before it builds or promotes anything.
The GitHub release contains the generated changelog and SBOM assets. The SBOM archive is signed with Cosign, and the production object store receives the release VERSION marker only after package promotion is complete. The workflow also dispatches the documentation release-notes workflow after the current version marker is set and sends a release notification after the GitHub release is ready.
References: bin/tag-and-release.sh• L3-13 bin/tag-and-release.sh• L46-131 bin/verify-tag.sh• L14-24 .github/…/deploy-prod.yaml• L9-37 .github/…/deploy-prod.yaml• L189-318 Makefile• L739-781
Change checklist
When these files or sections are changed, remember to consider these:
- Update the package list and the change-detection paths together when a new artifact type or source path is added. The staging, versioned upload, single-package rebuild, and PR candidate flows share this decision.
- Keep the core rebuild set and the copy set ordered so a copied package cannot overwrite a package built from the PR source.
- Keep the PR candidate storage prefix, credential policy, and versioned-only catalog writes aligned. A broader write path can expose shared staging or production state.
- Keep the pull-request workflow's checkout boundary and required-reviewer environment aligned. PR-authored build code must not receive broad storage or registry credentials.
- Keep the per-run utility-image tag aligned with the image name rendered into candidate installer templates. Reusing the base image still requires publishing the candidate tag.
- Preserve the sticky TestGrid comment marker and queued-run format if comment reporting changes. The result checker uses that contract to find active runs.
- Regenerate the OS-keyed Make targets, manifest cases, and installer preflight cases when the supported OS matrix changes. Check that Kubernetes host packages include the new OS and that host-specific Kubernetes and container-runtime rules still match it.
- Keep the generated add-on catalog and the installer version source aligned. A catalog change affects both the versioned and current object-store keys.
- Preserve the link between a commit-based staging release and its TestGrid reference. Production promotion depends on finding that exact candidate.
- Keep release tag rules,
VERSIONobject-store markers, package paths, and GitHub release names consistent. Clients use these values as release identity. - Treat SBOM signing inputs as release inputs. A change to the SBOM generator or signing flow affects the GitHub release assets.
- Keep image scan alert rules and result collection aligned. A change can turn a visible vulnerability into a non-blocking result or lose the combined report.
- Keep the component generator output and automated pull-request metadata aligned. The generated versions and bundled dependency versions are part of the review and release record.
- Preserve CDN purge paths when a single-package rebuild changes versioned or current object keys. A stale cache can hide the repaired artifact.
- Keep the production release-notes dispatch after the current production version is set. The documentation flow uses the published version and release context.
- Keep add-on matrix outputs, reusable-workflow inputs, artifact names, and sticky-comment markers aligned. A mismatch can hide a completed TestGrid result from the pull request.
- Keep add-on pull-request filters and concurrency limits aligned with the intended test scope. A skipped or overlapping run can leave a changed add-on without a clear result.
- Keep the pull-request spec patch limited to empty installer-version entries. Rewriting already released entries points them at a staging path where they were not published.
- Keep the pull-request helper checkout separate from the branch checkout. The helper must work for older manual-dispatch branches without exposing branch-controlled build code to registry credentials.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A supported OS changes without regenerated build rules, change detection, or installer preflight rules | The release can lack host packages or the installer can reject a package for an OS that the build accepts | The generated OS matrix, Kubernetes package paths, and common preflight rules must stay in sync |
| A supported host uses an incompatible Kubernetes target or container runtime | Installation stops even though the host OS itself is supported | Installer preflights check host-specific Kubernetes and CRI compatibility before install or upgrade |
| A package has no source path or stored source metadata | The uploader rebuilds it or cannot make a safe reuse decision | Package enumeration supplies a path and upload metadata stores the source identifier |
The staging catalog or VERSION marker is published before packages are ready | Installers can select an incomplete release | The staging workflow sets the marker after package and catalog jobs finish |
| A PR candidate writes shared staging metadata or production paths | A pre-merge test can change the release used by other installs | The candidate flow writes versioned candidate paths only and uses a protected least-privilege environment |
| PR-authored build code receives broad storage or registry credentials | A compromised change can affect shared releases or external images | The workflow skips forks, gates secrets with required reviewers, and scopes storage writes to the candidate prefix |
| The candidate's rendered utility-image tag is not present in the registry | Installer scenarios fail before they start with an image-pull error | The workflow builds or retags the utility image under the candidate version tag |
| The core build and copy jobs finish in the wrong order | A copied old package can replace the PR's package | The build-and-upload job waits for copying and writes the overlapping package set last |
The PR candidate cannot read the current staging VERSION | The workflow cannot identify the package set to reuse | Tag creation fails when the shared staging marker is empty |
| The sticky TestGrid queue marker changes without a checker update | Queued runs are not tracked in the PR comment | The PR comment keeps the marker and link format consumed by the result checker |
| Per-run utility-image tags are never removed | Shared Docker Hub accumulates externally visible RC tags | S3 RC objects have staging cleanup, but Docker Hub tag cleanup remains an explicit operational gap |
| The production tag has the wrong date or shape | Production release work stops before publication | verify-tag.sh validates the tag before dependent jobs run |
| The staging TestGrid run is missing, duplicated, or pending | An unverified candidate can block or corrupt promotion | verify-testgrid-run.sh requires one complete run |
| The SBOM signing key or generator is unavailable | The GitHub release cannot publish its signed dependency assets | Build initialization requires the key and verifies the downloaded generator |
| The staging candidate does not match the tagged commit | Production cannot safely promote the tested artifacts | The production workflow finds the staging directory by the tag commit and verifies its TestGrid result |
| A single-package upload completes without cache purge | Clients can continue to receive the old archive | The rebuild workflows purge both versioned and current package paths |
| An alerting image has a fixed high-severity vulnerability | The scheduled scan reports failure and stores its result | Syft and Grype scan OS content, and alerting matrix entries do not ignore scan errors |
| An add-on test rewrites shared staging metadata | Concurrent staging installs can resolve packages that do not exist there | Add-on tests use an override URL and leave shared generated version data unchanged |
| An add-on matrix leg does not publish its message artifact | The pull request comment can omit that test's TestGrid result | Each reusable-workflow run writes a named message artifact and the parent combines all matching artifacts |
| The add-on pull-request filter or skip label excludes a changed version | A changed add-on can merge without its intended TestGrid check | The workflow path and label rules must match the repository's required test policy |
| The release-notes dispatch runs before the GitHub release exists | The documentation update can lack the release context or fail to publish | The production workflow dispatches it only after the current version marker is set and passes the release tag |
| An upstream component generator creates no change or omits its version output | No update PR is opened or its title and release note lack the new version | Each updater runs the component generator before creating the PR and uses its version output in the PR metadata |
| A candidate spec rewrites a real released installer version to the staging endpoint | TestGrid requests a release that does not exist under the candidate staging path | The PR spec patch changes only entries with the empty installer-version placeholder |
| A manual run uses a branch without the helper script | Candidate image resolution fails before the run can build | The workflow fetches the helper from the workflow's own ref into a separate checkout |
Key files
| File | Why to read it |
|---|---|
Makefile | Defines the shared build graph, archive targets, installer templates, OS package targets, tests, SBOM, and release entry point. |
kurl_util/Makefile | Shows how helper binaries and the utility image support the main build. |
| bin/list-all-packages.sh | Defines the package catalog and the source paths that control rebuild decisions. |
| bin/list-all-packages-actions-matrix.sh | Converts the package catalog into parallel CI batches. |
| bin/save-manifest-assets.sh | Defines how manifests become images, assets, and OS package content inside an archive. |
| bin/generate-addons.js | Produces and publishes the add-on and supported-version catalogs. |
| bin/upload-dist-staging.sh | Builds or reuses candidate artifacts and publishes them to staging. |
| bin/upload-dist-versioned.sh | Builds, copies, and promotes artifacts into versioned paths. |
| .github/…/build-package-staging.yaml | Rebuilds one package for staging and refreshes both versioned and current staging paths. |
| .github/…/build-package-prod.yaml | Rebuilds one package for the latest production tag and refreshes both production paths. |
| .github/…/deploy-staging.yaml | Describes the staging release candidate from build through TestGrid. |
| .github/…/testgrid-pr.yaml | Describes isolated core pull-request builds, candidate storage, image-tag handling, spec selection, credential boundaries, and TestGrid submission. |
| bin/testgrid-pr-kurl-util.sh | Defines the utility-image tag that candidate installer templates resolve at install time. |
| bin/testgrid-pr-spec.sh | Pins candidate TestGrid entries to the candidate version and staging endpoint without changing released entries. |
| .github/…/deploy-prod.yaml | Describes tag validation, tagged package builds, tested-candidate promotion, release publishing, release-notes dispatch, and production validation. |
| .github/…/test-addon-pr.yaml | Selects changed add-on versions, controls their matrix execution, and combines their TestGrid messages into one pull-request comment. |
| .github/…/test-addon.yaml | Builds a temporary add-on archive, submits its TestGrid specifications, and exports one result message for the parent workflow. |
| .github/…/cron-scan-images-daily.yaml | Defines the scheduled image scan matrix and combined failure report. |
| .github/…/update-*.yaml | Shows how scheduled and manual upstream component checks create reviewed version-update pull requests. |
| scripts/…/preflights.sh | Enforces installer checks that must agree with the supported OS, Kubernetes package, and container-runtime matrix. |
| bin/tag-and-release.sh | Controls creation and push of the release tag. |
| bin/verify-testgrid-run.sh | Guards production promotion with completed staging test results. |
| scripts/initialize-build.sh | Prepares the SBOM generator and signing key input. |
| bin/cleanup-staging-s3.sh | Removes old staging and pull-request objects while leaving active release markers in place. |