Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
- `.github/workflows/container.yml` — reusable native AMD64 (`ubuntu-26.04`) and ARM64 (`ubuntu-26.04-arm`) builder image construction, OCI export with SBOM and SLSA provenance, native runtime validation, and loaded-config verification.
- `.github/workflows/release.yml` — triggered on `vMAJOR.MINOR.PATCH` tags (authoritative Codebelt engine version without leading `v`); runs all quality gates, assembles the exact native-verified AMD64/ARM64 manifests into one multi-platform OCI index without rebuilding, verifies via `tools/OciArtifact.cs` and `codebeltnet/oci-artifact-verify@v1`, splits assets <= 1 GiB, creates a draft GitHub Release, verifies durable asset attachment, and cleans transient Actions artifacts.
- `.github/workflows/deploy.yml` — triggered on GitHub Release `published` (human approval gate) or `workflow_dispatch` from `main` for idempotent recovery; resolves the latest published stable release, validates tag ancestry on `main` and the authoritative `release.yml` run attempt, reconstructs and verifies the exact OCI archive, then promotes it to Docker Hub via Skopeo (`--all --preserve-digests`) under the `Production` environment without rebuilding.
- Engine-qualified tags (`2-v1.1.0`, `2.81-v1.1.0`, `2.81.0-v1.1.0`) are promoted and verified before floating convenience tags (`latest`, `2`, `2.81`, `2.81.0`). Conflicting engine-qualified tags fail closed; identical index digests allow idempotent recovery; superseded releases are blocked from rolling back floating convenience tags.
- Engine-qualified tags (`2-v1.1.0`, `2.81-v1.1.0`, `2.81.0-v1.1.0`) are promoted and verified before floating versioned convenience tags (`2`, `2.81`, `2.81.0`); `:latest` is not generated or published. Conflicting engine-qualified tags fail closed; identical index digests allow idempotent recovery; superseded releases are blocked from rolling back floating convenience tags.
- Direct `BuildAndPushDocfxImage.ps1 -Publish` targeting `codebeltnet/docfx` or `docker.io/codebeltnet/docfx` is intentionally disabled so official production releases cannot bypass the build-once promotion lifecycle.
- Distinguish repository-implemented workflow automation from manual GitHub administration (the `Production` environment, required reviewers, `DOCKERHUB_USERNAME`/`DOCKERHUB_TOKEN` environment secrets, `main` ruleset required check `Required quality gate`, and Docker Hub selective immutable-tag rules). Never claim administrative settings are configured unless verified.

Expand Down
12 changes: 6 additions & 6 deletions BuildAndPushDocfxImage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ if ($BuildOnly) {
'--provenance=mode=max'
'.'
)
Invoke-DocfxDocker $ociArgs
Invoke-DocfxDocker $ociArgs | Out-Host

$verified = Invoke-OciArtifact -Arguments @(
'verify', $archiveFullPath
Expand All @@ -161,8 +161,8 @@ if ($BuildOnly) {
$localImage = "docfx-verify:${cpu}-$([guid]::NewGuid().ToString('N'))"
$loadArchive = Join-Path ([IO.Path]::GetTempPath()) "docfx-load-${cpu}-$([guid]::NewGuid().ToString('N')).docker.tar"
try {
Invoke-Skopeo -Arguments @('copy', '--override-os', 'linux', '--override-arch', $cpu, "oci-archive:$archiveFullPath", "docker-archive:${loadArchive}:${localImage}")
Invoke-DocfxDocker @('load', '--input', $loadArchive)
$null = Invoke-Skopeo -Arguments @('copy', '--override-os', 'linux', '--override-arch', $cpu, "oci-archive:$archiveFullPath", "docker-archive:${loadArchive}:${localImage}")
Invoke-DocfxDocker @('load', '--input', $loadArchive) | Out-Host
} finally {
if (Test-Path -LiteralPath $loadArchive) {
Remove-Item -LiteralPath $loadArchive -Force
Expand All @@ -189,7 +189,7 @@ if ($BuildOnly) {
$details = @((Invoke-DocfxDocker @('image', 'inspect', $localImage)) -join "`n" | ConvertFrom-Json)[0]

foreach ($reference in $tagPlan.AllReferences) {
Invoke-DocfxDocker @('tag', $localImage, $reference)
Invoke-DocfxDocker @('tag', $localImage, $reference) | Out-Host
}

$record = [pscustomobject]@{
Expand Down Expand Up @@ -224,7 +224,7 @@ foreach ($reference in $tagPlan.AllReferences) {
}

if (-not $Publish) {
Invoke-DocfxDocker ($buildArguments.ToArray() + @('--load', '.'))
Invoke-DocfxDocker ($buildArguments.ToArray() + @('--load', '.')) | Out-Host
if ($PassThru) { return $plan }
return
}
Expand All @@ -235,7 +235,7 @@ foreach ($reference in $tagPlan.EngineQualifiedReferences) {

$metadataTemp = New-TemporaryFile
try {
Invoke-DocfxDocker ($buildArguments.ToArray() + @('--push', '--metadata-file', $metadataTemp.FullName, '.'))
Invoke-DocfxDocker ($buildArguments.ToArray() + @('--push', '--metadata-file', $metadataTemp.FullName, '.')) | Out-Host
$digest = (Get-Content -LiteralPath $metadataTemp.FullName -Raw | ConvertFrom-Json).'containerimage.digest'
if ($digest -cnotmatch '^sha256:[0-9a-f]{64}$') {
throw 'Buildx did not report a valid published image digest.'
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- Updated repository documentation (`README.md`, `framework-views/README.md`, `AGENTS.md`) and delivery tests (`tests/BuildAndPushDocfxImage.Tests.ps1`, `tests/ReleaseDelivery.Tests.ps1`) to document and enforce the six-tag versioned Docker image policy (three floating versioned convenience tags and three Codebelt engine-qualified tags).

### Removed

- Removed `:latest` Docker image tag generation and publication support from `Resolve-DocfxImageTagPlan` (`tools/DocfxImage.psm1`) so local builds, build-only OCI exports, release metadata, and Docker Hub promotions emit only versioned convenience tags (`MAJOR`, `MAJOR.MINOR`, `MAJOR.MINOR.PATCH`) and engine-qualified `-v{EngineVersion}` tags.

## [1.1.0] - 2026-11-25

This is a minor release that refactors native framework views onto convention-based discovery and modular metadata helpers, introduces engine-aware Docker image versioning with OCI metadata labels, establishes an automated build-once GitHub Actions CI/CD release and deployment lifecycle, and adds shared PowerShell 7 and .NET 10 delivery tooling with comprehensive unit and OCI verification suites.
Expand Down Expand Up @@ -94,6 +104,7 @@ This is the initial release of the DocFX builder Docker image.
- Added a DocFX builder Docker image that includes the default and modern templates,
- Added support for running the DocFX build process in a container.

[Unreleased]: https://github.com/codebeltnet/docfx/compare/v1.1.0..HEAD
[1.1.0]: https://github.com/codebeltnet/docfx/compare/v1.0.1..v1.1.0
[1.0.1]: https://github.com/codebeltnet/docfx/compare/v1.0.0..v1.0.1
[1.0.0]: https://github.com/codebeltnet/docfx/compare/v0.1.4..v1.0.0
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,26 +98,27 @@ Neither version is inferred from the other. The examples below use DocFX CLI `2.

### Convenience and engine-qualified tags

For a standard stable release containing one upstream DocFX CLI version, a single multi-platform build associates all seven tags with the same published image index:
For a standard stable release containing one upstream DocFX CLI version, a single multi-platform build associates all six versioned tags with the same published image index:

| Tag family | Image tag | Meaning |
| --- | --- | --- |
| Convenience | `codebeltnet/docfx:latest` | Latest published distribution |
| Convenience | `codebeltnet/docfx:2` | Latest published distribution within DocFX CLI major version `2` |
| Convenience | `codebeltnet/docfx:2.81` | Latest published distribution within DocFX CLI minor version `2.81` |
| Convenience | `codebeltnet/docfx:2.81.0` | Distribution using exact DocFX CLI version `2.81.0` |
| Engine-qualified | `codebeltnet/docfx:2-v1.1.0` | DocFX CLI major version `2` with Codebelt engine `1.1.0` |
| Engine-qualified | `codebeltnet/docfx:2.81-v1.1.0` | DocFX CLI minor version `2.81` with Codebelt engine `1.1.0` |
| Engine-qualified | `codebeltnet/docfx:2.81.0-v1.1.0` | Exact DocFX CLI `2.81.0` with Codebelt engine `1.1.0` |

**Versioned tagging policy:** `codebeltnet/docfx` does not generate, publish, or support a `:latest` Docker image tag. Consumers should always select an explicit versioned convenience tag (`2`, `2.81`, or `2.81.0`), a Codebelt engine-qualified tag (`2-v1.1.0`, `2.81-v1.1.0`, or `2.81.0-v1.1.0`), or a digest-pinned reference.

Prerelease versions never update floating stable convenience tags:

- A prerelease Codebelt engine version (for example, `1.2.0-rc.1` with DocFX CLI `2.81.0`) generates only the engine-qualified tags (`2.81.0-v1.2.0-rc.1`, `2.81-v1.2.0-rc.1`, `2-v1.2.0-rc.1`).
- A prerelease DocFX CLI version (for example, `2.82.0-preview.1` with stable Codebelt engine `1.2.0`) generates only the exact CLI tags (`2.82.0-preview.1-v1.2.0` and `2.82.0-preview.1`), or only `2.82.0-preview.1-v1.2.0-rc.1` when both dimensions are prereleases.

### Consumer control levels

Existing consumers do not need to migrate; unqualified convenience tags remain supported with their established behavior. Choose the reference level that matches your reproducibility needs:
Versioned convenience tags (`2`, `2.81`, `2.81.0`) remain supported, while `:latest` is intentionally not published or supported. Choose the reference level that matches your reproducibility needs:

- **Convenience** (for example, `codebeltnet/docfx:2` or `codebeltnet/docfx:2.81.0`): automatically receives updated Codebelt engine releases for that DocFX CLI scope. Convenient for low-maintenance builds, but pulling a newer image can introduce breaking Codebelt engine changes independently of the upstream DocFX CLI.
- **Explicit version selection** (for example, `codebeltnet/docfx:2-v1.1.0` or `codebeltnet/docfx:2.81.0-v1.1.0`): selects a specific Codebelt engine release. Published engine-qualified release tags are never intentionally reassigned to different image content during ordinary release operations, and `BuildAndPushDocfxImage.ps1 -Publish` refuses to overwrite existing engine-qualified tags. Because these tags stay fixed to one release, they do not automatically receive future patches or security updates; adopt a newer `-v<EngineVersion>` release explicitly.
Expand Down Expand Up @@ -147,7 +148,7 @@ From the repository root, use PowerShell 7 and Docker Buildx in Linux-container
pwsh -NoProfile -File ./BuildAndPushDocfxImage.ps1 -Tag docfx-local
```

Without `-EngineVersion`, the default loads one platform into Docker and tags it with the existing convenience tags (`docfx-local:2.81.0`, `docfx-local:2.81`, `docfx-local:2`, and `docfx-local:latest`). Pass `-EngineVersion` to also generate the engine-qualified tags and set `org.opencontainers.image.version` locally:
Without `-EngineVersion`, the default loads one platform into Docker and tags it with the versioned convenience tags (`docfx-local:2.81.0`, `docfx-local:2.81`, and `docfx-local:2`). Pass `-EngineVersion` to also generate the engine-qualified tags and set `org.opencontainers.image.version` locally:

```powershell
pwsh -NoProfile -File ./BuildAndPushDocfxImage.ps1 -Tag docfx-local -EngineVersion 1.1.0
Expand Down Expand Up @@ -192,7 +193,7 @@ Pull request (.github/workflows/pr.yml)
-> Create draft GitHub Release with durable split OCI assets & checksums, then clean transient CI artifacts
-> Human approves and publishes the GitHub Release (.github/workflows/deploy.yml)
-> Reconstruct & re-verify durable OCI assets, then promote to Docker Hub via Skopeo (--all --preserve-digests)
-> Verify all seven tags resolve to the exact multi-platform OCI index digest & re-verify downloaded registry content
-> Verify all six tags resolve to the exact multi-platform OCI index digest & re-verify downloaded registry content
```

### Workflow segregation
Expand All @@ -209,7 +210,7 @@ Pull request (.github/workflows/pr.yml)
- **Release tag convention:** Git tags use `vMAJOR.MINOR.PATCH` (for example, `v1.1.0`), which defines Codebelt engine version `1.1.0`. The upstream DocFX CLI version (`2.81.0`) is maintained independently in `Dockerfile` (`ARG DOCFX_VERSION`).
- **Single implementation:** Local builds (`BuildAndPushDocfxImage.ps1`), CI container validation, release assembly, and deployment promotion all share [`tools/DocfxImage.psm1`](tools/DocfxImage.psm1) and [`tools/OciArtifact.cs`](tools/OciArtifact.cs) (a `.NET 10` file-based C# application).
- **Direct-publish safeguard:** `BuildAndPushDocfxImage.ps1 -Publish` intentionally refuses direct `docker buildx build --push` against the official `codebeltnet/docfx` (or `docker.io/codebeltnet/docfx`) repository so production releases cannot bypass build-once native verification and release approval. Custom or fork registries (for example, `-ContainerRegistry localhost:5000/team/`) remain supported for local/fork workflows.
- **Two-phase promotion & conflict protection:** `deploy.yml` preflights all engine-qualified tags (`2.81.0-v1.1.0`, `2.81-v1.1.0`, `2-v1.1.0`) before any registry write. Missing tags are uploaded; tags already pointing to the exact expected OCI index digest are accepted for idempotent retry; any tag pointing to different content fails closed without overwriting. Floating convenience tags (`2.81.0`, `2.81`, `2`, `latest`) are updated only after all engine-qualified tags exist in the registry with the exact expected digest and after re-confirming the release is still the latest published stable release.
- **Two-phase promotion & conflict protection:** `deploy.yml` preflights all engine-qualified tags (`2.81.0-v1.1.0`, `2.81-v1.1.0`, `2-v1.1.0`) before any registry write. Missing tags are uploaded; tags already pointing to the exact expected OCI index digest are accepted for idempotent retry; any tag pointing to different content fails closed without overwriting. Floating convenience tags (`2.81.0`, `2.81`, `2`) are updated only after all engine-qualified tags exist in the registry with the exact expected digest and after re-confirming the release is still the latest published stable release.
- **Post-publish verification:** After promotion, `deploy.yml` inspects every promoted tag's raw manifest digest to prove no manifest rewriting occurred, then downloads the image by immutable digest (`codebeltnet/docfx@sha256:<index-digest>`) and re-verifies all blobs, both platforms, OCI labels, SPDX SBOM, and SLSA provenance.

### Deployment recovery procedure
Expand All @@ -219,7 +220,7 @@ To resume or recover a partially completed production deployment of the latest p
1. Never rebuild the image or re-tag a release for recovery.
2. In GitHub Actions, manually dispatch **Deploy Docker Hub images** (`.github/workflows/deploy.yml`) from branch `main` with `tag` set to the already-published latest release tag (for example, `v1.1.0`).
3. `deploy.yml` loads deployment tooling from `main` (pinned to a single `deployment-sha`), downloads the original durable OCI assets from the GitHub Release, re-verifies checksums, the authoritative `release.yml` run, native results, and OCI attestations, skips any engine-qualified tag already matching the exact expected index digest, and completes the remaining promotions idempotently.
4. Attempting to dispatch recovery from a non-`main` branch, for a draft/prerelease, or for an older superseded release is automatically rejected to prevent rolling back floating convenience tags (`latest`, `2`, `2.81`, `2.81.0`).
4. Attempting to dispatch recovery from a non-`main` branch, for a draft/prerelease, or for an older superseded release is automatically rejected to prevent rolling back floating convenience tags (`2`, `2.81`, `2.81.0`).

### Manual GitHub & Docker Hub administrative configuration

Expand Down
2 changes: 1 addition & 1 deletion framework-views/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Include `templates/ms-style` in the DocFX `build.template` list. The generator u

The shared builder image distributes the same script and packaging assets at `/opt/docfx/framework-views/` and matching templates at `/opt/docfx/templates/`. It includes PowerShell 7, the .NET 10 and .NET 11 SDKs, and DocFX 2.81.0. The consumer's `global.json` can select an installed project SDK independently of the resolver. For other SDK pins, run from the source distribution with the required SDKs on the host or supply them in a derived builder.

Use the approved image index digest from the [CI/CD release and deployment lifecycle](../README.md#cicd-release-and-deployment-lifecycle). See [Docker image versioning](../README.md#docker-image-versioning) for the trade-offs between convenience tags (`codebeltnet/docfx:2`, `:2.81`, `:2.81.0`, `:latest`), engine-qualified tags (`:2-v1.1.0`, `:2.81-v1.1.0`, `:2.81.0-v1.1.0`), and digest-pinned references; existing convenience-tag references remain supported and migration is optional. The `1.1.0` example below illustrates the naming contract and is not publicly available until release publication occurs. For branch testing, [build the image locally](../README.md#build-the-builder-image-locally) with `-Tag docfx-local -EngineVersion 1.1.0` and substitute `docfx-local:2.81.0-v1.1.0` (or `docfx-local:2.81.0`) below.
Use the approved image index digest from the [CI/CD release and deployment lifecycle](../README.md#cicd-release-and-deployment-lifecycle). See [Docker image versioning](../README.md#docker-image-versioning) for the trade-offs between versioned convenience tags (`codebeltnet/docfx:2`, `:2.81`, `:2.81.0`), engine-qualified tags (`:2-v1.1.0`, `:2.81-v1.1.0`, `:2.81.0-v1.1.0`), and digest-pinned references; `:latest` is not published or supported, while versioned convenience-tag references remain supported. The `1.1.0` example below illustrates the naming contract and is not publicly available until release publication occurs. For branch testing, [build the image locally](../README.md#build-the-builder-image-locally) with `-Tag docfx-local -EngineVersion 1.1.0` and substitute `docfx-local:2.81.0-v1.1.0` (or `docfx-local:2.81.0`) below.

Run the entire generator in the selected image. Mount the consumer checkout writable for restore and build outputs.

Expand Down
Loading