Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!csrun.ps1
!container-entrypoint.ps1
!container-build.ps1
6 changes: 6 additions & 0 deletions .github/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# GitHub-hosted labels verified against the official runner reference.
# This supplements actionlint's label inventory; these are not self-hosted jobs.
self-hosted-runner:
labels:
- ubuntu-26.04
- ubuntu-26.04-arm
81 changes: 81 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Container validation

on:
workflow_call:

permissions:
contents: read

jobs:
container:
name: Native ${{ matrix.arch.architecture }} SDK ${{ matrix.sdk }}
runs-on: ${{ matrix.arch.runner }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
sdk: ['10', '11', '10-11']
arch:
- { architecture: amd64, runner: ubuntu-26.04 }
- { architecture: arm64, runner: ubuntu-26.04-arm }
steps:
- uses: codebeltnet/git-checkout@v1
with:
ref: ${{ github.sha }}
- uses: codebeltnet/install-dotnet@v3
with:
versionPrecision: patch
- name: Install OCI transfer tool
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends skopeo
- name: Enable OCI exporter
run: docker buildx create --driver docker-container --use
- name: Validate OCI integrity and promotion contracts
run: python tests/oci.Tests.py
- name: Validate publishing contract
shell: pwsh
run: ./tests/BuildAndPublish.Tests.ps1
- name: Build once and execute exported candidate on native CPU
shell: pwsh
env:
SDK_CHANNELS: ${{ matrix.sdk }}
TARGET_PLATFORM: linux/${{ matrix.arch.architecture }}
run: |
$ErrorActionPreference = 'Stop'
$installed = @(& dotnet --list-sdks)
if ($LASTEXITCODE -ne 0) { throw 'Unable to list installed SDKs.' }
$versions = foreach ($major in $env:SDK_CHANNELS.Split('-')) {
$sdk = $installed | ForEach-Object {
if ($_ -match "^($major\.0\.\d+)\s+\[") { $Matches[1] }
} | Sort-Object { [version]$_ } -Descending | Select-Object -First 1
if (-not $sdk) { throw "Codebelt did not provide a .NET $major GA SDK." }
$sdk
}
$version = if ($env:GITHUB_REF_TYPE -eq 'tag') { $env:GITHUB_REF_NAME } else { 'v0.2.0' }
Import-Module ./BuildAndPublish.psm1 -Force
BuildAndPublish -SdkVersion $versions -Platform $env:TARGET_PLATFORM -EnginePath ./csrun.ps1 -EngineVersion $version -BuildOnly -PassThru | Format-List
- name: Preserve exact tested OCI content and native result
if: github.event_name == 'push' && github.ref_type == 'tag'
uses: actions/upload-artifact@v7
with:
name: container-${{ matrix.sdk }}--${{ matrix.arch.architecture }}
path: artifacts/*
compression-level: 0
if-no-files-found: error
retention-days: 1
- name: Preserve PR validation metadata without large image transfers
if: github.event_name != 'push' || github.ref_type != 'tag'
uses: actions/upload-artifact@v7
with:
name: container-metadata-${{ matrix.sdk }}--${{ matrix.arch.architecture }}-${{ github.run_attempt }}
path: artifacts/*.json
if-no-files-found: error
retention-days: 7
quality:
name: Both native architectures and all SDK variants
if: always()
needs: [container]
runs-on: ubuntu-26.04
steps:
- env:
RESULT: ${{ needs.container.result }}
run: test "$RESULT" = success
108 changes: 108 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Deploy Docker Hub images

on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: Published latest release to recover; existing verified artifacts only
required: true
type: string

permissions:
contents: read

concurrency:
group: csrun-production
cancel-in-progress: false

jobs:
resolve:
name: Resolve latest published engine once
runs-on: ubuntu-26.04
timeout-minutes: 60
outputs:
sha: ${{ steps.resolve.outputs.sha }}
steps:
- uses: codebeltnet/git-checkout@v1
with:
ref: main
- id: resolve
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.event.release.tag_name || inputs.tag }}
run: python tools/release-images.py resolve
- uses: actions/upload-artifact@v7
with:
name: resolved-release
path: resolved/*
retention-days: 7
if-no-files-found: error

verify:
name: Validate saved SDK ${{ matrix.sdk }} release artifact
needs: resolve
runs-on: ubuntu-26.04
timeout-minutes: 60
permissions:
contents: read
actions: read
strategy:
fail-fast: false
matrix:
sdk: ['10', '11', '10-11']
steps:
- uses: codebeltnet/git-checkout@v1
with:
ref: ${{ needs.resolve.outputs.sha }}
- uses: actions/download-artifact@v8
with:
name: resolved-release
path: resolved
- name: Validate release run, native results, checksums and attestations
env:
GH_TOKEN: ${{ github.token }}
SDK_VARIANT: ${{ matrix.sdk }}
run: python tools/release-images.py restore "$SDK_VARIANT"

publish:
name: Promote SDK ${{ matrix.sdk }} to Docker Hub
needs: [resolve, verify]
runs-on: ubuntu-26.04
timeout-minutes: 60
environment: Production
permissions:
contents: read
actions: read
strategy:
fail-fast: false
max-parallel: 1
matrix:
sdk: ['10', '11', '10-11']
steps:
- uses: codebeltnet/git-checkout@v1
with:
ref: ${{ needs.resolve.outputs.sha }}
- uses: actions/download-artifact@v8
with:
name: resolved-release
path: resolved
- name: Restore exact verified release artifact
env:
GH_TOKEN: ${{ github.token }}
SDK_VARIANT: ${{ matrix.sdk }}
run: python tools/release-images.py restore "$SDK_VARIANT"
- name: Install OCI transfer tool
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends skopeo
- name: Authenticate, promote without rebuild and inspect registry content
env:
GH_TOKEN: ${{ github.token }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
set -euo pipefail
export REGISTRY_AUTH_FILE="$RUNNER_TEMP/csrun-auth.json"
trap 'rm -f "$REGISTRY_AUTH_FILE"' EXIT
printf '%s' "$DOCKERHUB_TOKEN" | skopeo login --authfile "$REGISTRY_AUTH_FILE" --username "$DOCKERHUB_USERNAME" --password-stdin docker.io
python tools/release-images.py publish
17 changes: 15 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ concurrency:
cancel-in-progress: true

jobs:
containers:
uses: ./.github/workflows/container.yml

test:
name: Windows .NET 11 integration tests
runs-on: windows-latest
runs-on: windows-2025
timeout-minutes: 20
steps:
- name: Checkout
Expand Down Expand Up @@ -46,7 +49,7 @@ jobs:

compatibility:
name: Windows .NET 10 compatibility
runs-on: windows-latest
runs-on: windows-2025
timeout-minutes: 10
steps:
- name: Checkout
Expand All @@ -67,3 +70,13 @@ jobs:
} | Sort-Object { [version]$_ } -Descending | Select-Object -First 1
if (-not $sdk) { throw 'Codebelt did not provide a .NET 10 GA SDK.' }
pwsh -NoProfile -File ./tests/csrun.Tests.ps1 -CompatibilityOnly -SdkVersion $sdk

quality:
name: Required quality gate
if: always()
needs: [test, compatibility, containers]
runs-on: ubuntu-26.04
steps:
- env:
RESULTS: ${{ toJSON(needs) }}
run: echo "$RESULTS" | jq -e 'all(.[]; .result == "success")'
78 changes: 70 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ concurrency:
cancel-in-progress: false

jobs:
containers:
uses: ./.github/workflows/container.yml

test:
name: Test tagged script
runs-on: windows-latest
runs-on: windows-2025
timeout-minutes: 20
steps:
- name: Validate release version
Expand Down Expand Up @@ -51,7 +54,7 @@ jobs:

compatibility:
name: Test tagged script on .NET 10
runs-on: windows-latest
runs-on: windows-2025
timeout-minutes: 10
steps:
- name: Checkout tagged commit
Expand All @@ -73,20 +76,79 @@ jobs:
if (-not $sdk) { throw 'Codebelt did not provide a .NET 10 GA SDK.' }
pwsh -NoProfile -File ./tests/csrun.Tests.ps1 -CompatibilityOnly -SdkVersion $sdk

images:
name: Preserve verified SDK ${{ matrix.sdk }} index
timeout-minutes: 45
needs: [test, compatibility, containers]
runs-on: ubuntu-26.04
strategy:
fail-fast: false
matrix:
sdk: ['10', '11', '10-11']
steps:
- uses: codebeltnet/git-checkout@v1
with:
ref: ${{ github.sha }}
- uses: codebeltnet/install-dotnet@v3
with:
versionPrecision: patch
- uses: actions/download-artifact@v8
with:
pattern: container-${{ matrix.sdk }}--*
path: inputs
- name: Assemble exact native-tested content
env:
SDK_VARIANT: ${{ matrix.sdk }}
run: python tools/release-images.py assemble "$SDK_VARIANT"
- id: identity
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- uses: codebeltnet/oci-artifact-verify@v1
with:
archive-path: ${{ github.workspace }}/out/image.tar
checksum-path: ${{ github.workspace }}/out/image.tar.sha256
version: ${{ steps.identity.outputs.version }}
revision: ${{ github.sha }}
- name: Split release assets below GitHub's per-file limit
env:
SDK_VARIANT: ${{ matrix.sdk }}
run: python tools/release-images.py split "$SDK_VARIANT"
- uses: actions/upload-artifact@v7
with:
name: release-image-${{ matrix.sdk }}
path: assets/*
compression-level: 0
retention-days: 1
if-no-files-found: error

release:
name: Create draft release
needs: [test, compatibility]
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [test, compatibility, containers, images]
runs-on: ubuntu-26.04
timeout-minutes: 15
permissions:
actions: read
actions: write
contents: write
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_TAG: ${{ github.ref_name }}
steps:
- uses: actions/download-artifact@v8
with:
pattern: release-image-*
path: release
merge-multiple: true
- name: Download tested script
run: gh run download "$GITHUB_RUN_ID" --name "csrun-$RELEASE_TAG" --dir release
- name: Create draft with tested standalone asset
run: gh release create "$RELEASE_TAG" release/csrun.ps1 --verify-tag --draft --generate-notes --title "$RELEASE_TAG"
- name: Create draft with tested engine and OCI assets
run: |
cd release
sha256sum csrun.ps1 > csrun.ps1.sha256
gh release create "$RELEASE_TAG" ./* --verify-tag --draft --generate-notes --title "$RELEASE_TAG"
- name: Remove transient CI copies after durable release attachment
continue-on-error: true
run: |
gh api "repos/$GH_REPO/actions/runs/$GITHUB_RUN_ID/artifacts?per_page=100" --jq '.artifacts[].id' |
while read -r artifact_id; do
gh api --method DELETE "repos/$GH_REPO/actions/artifacts/$artifact_id"
done
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/artifacts/

__pycache__/
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
- Reference actions and reusable workflows with floating version tags, not commit SHAs.
- Use external actions only where the Codebelt ecosystem has no suitable equivalent.

- Use fixed `ubuntu-26.04` (AMD64) and `ubuntu-26.04-arm` (ARM64) runners for every Linux job. Never use `ubuntu-latest` or older Ubuntu runner labels. Keep Windows validation on `windows-2025`; runner upgrades require review.

## .NET support policy

- Use only .NET 10 and later SDKs, runtimes, and application/test target frameworks. Do not introduce .NET 8, .NET 9, or older execution targets.
Expand Down
Loading