77 tags:
88 - 'v*'
99 paths:
10- - '.github/workflows/runtime-image.yml'
10+ - '.github/workflows/runtime-image*.yml'
11+ - 'scripts/runtime-image/**'
1112 - 'docker/clawscan-runtime/**'
1213 pull_request:
1314 paths:
14- - '.github/workflows/runtime-image.yml'
15+ - '.github/workflows/runtime-image*.yml'
16+ - 'scripts/runtime-image/**'
1517 - 'docker/clawscan-runtime/**'
1618 workflow_dispatch:
1719
1820permissions:
1921 contents: read
20- packages: write
2122
2223jobs:
24+ verify:
25+ if: github.event_name == 'pull_request'
26+ uses: ./.github/workflows/runtime-image-platform.yml
27+ permissions:
28+ contents: read
29+ with:
30+ publish: false
31+
2332 build:
2433 if: github.event_name != 'pull_request'
25- name: Build runtime image
34+ uses: ./.github/workflows/runtime-image-platform.yml
35+ permissions:
36+ contents: read
37+ packages: write
38+ with:
39+ publish: true
40+
41+ merge:
42+ name: Publish complete runtime manifest
43+ needs: build
44+ if: github.event_name != 'pull_request' && needs.build.result == 'success'
2645 runs-on: ubuntu-latest
46+ timeout-minutes: 10
47+ permissions:
48+ contents: read
49+ packages: write
50+ concurrency:
51+ group: clawscan-runtime-publication
52+ cancel-in-progress: false
2753 steps:
2854 - name: Checkout
2955 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
30-
31- - name: Set up QEMU
32- uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
56+ with:
57+ persist-credentials: false
3358
3459 - name: Set up Docker Buildx
3560 uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
3661
37- - name: Log in to GitHub Container Registry
38- if: github.event_name != 'pull_request'
39- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
62+ - name: Download this run's native proofs
63+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
4064 with:
41- registry: ghcr.io
42- username: ${{ github.actor }}
43- password: ${{ github.token }}
65+ pattern: runtime-image-proof-linux-*
66+ path: runtime-image-proof
4467
4568 - name: Resolve image metadata
4669 id: meta
@@ -53,85 +76,24 @@ jobs:
5376 type=semver,pattern={{major}}.{{minor}}
5477 type=raw,value=latest,enable={{is_default_branch}}
5578
56- - name: Build image
57- uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
58- with:
59- context: ./docker/clawscan-runtime
60- file: docker/clawscan-runtime/Dockerfile
61- platforms: linux/amd64,linux/arm64
62- push: ${{ github.event_name != 'pull_request' }}
63- tags: ${{ steps.meta.outputs.tags }}
64- labels: ${{ steps.meta.outputs.labels }}
65-
66- verify:
67- if: github.event_name == 'pull_request'
68- name: Verify runtime image (${{ matrix.arch }})
69- runs-on: ${{ matrix.os }}
70- timeout-minutes: 45
71- permissions:
72- contents: read
73- strategy:
74- fail-fast: false
75- matrix:
76- include:
77- - os: ubuntu-latest
78- arch: amd64
79- - os: ubuntu-24.04-arm
80- arch: arm64
81- steps:
82- - name: Checkout
83- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
84-
85- - name: Set up Docker Buildx
86- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
87-
88- # A real single-platform Docker export/load, not a cache-only PR build.
89- # Native runners avoid treating emulated CLI execution as architecture proof.
90- - name: Build and load image
91- id: image
92- uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
79+ - name: Log in to GitHub Container Registry
80+ uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
9381 with:
94- context: ./docker/clawscan-runtime
95- file: docker/clawscan-runtime/Dockerfile
96- platforms: linux/${{ matrix.arch }}
97- push: false
98- load: true
99- provenance: false
100- tags: clawscan-runtime:ci
82+ registry: ghcr.io
83+ username: ${{ github.actor }}
84+ password: ${{ github.token }}
10185
102- - name: Record immutable loaded-image identity
103- shell: bash
86+ - name: Validate both digests and publish one complete index
10487 env:
105- BUILD_DIGEST: ${{ steps.image.outputs.digest }}
106- EXPECTED_ARCH: ${{ matrix.arch }}
107- run: |
108- set -euo pipefail
109- [[ "$BUILD_DIGEST" =~ ^sha256:[0-9a-f]{64}$ ]]
110- image_id="$(docker image inspect --format '{{.Id}}' clawscan-runtime:ci)"
111- [[ "$image_id" =~ ^sha256:[0-9a-f]{64}$ ]]
112- [[ "$(docker image inspect --format '{{.Architecture}}' "$image_id")" == "$EXPECTED_ARCH" ]]
113- [[ "$(docker image inspect --format '{{.Os}}' "$image_id")" == linux ]]
114- mkdir -p runtime-image-proof
115- printf 'source=%s\nplatform=linux/%s\nbuild_digest=%s\nloaded_image_id=%s\n' \
116- "$(git rev-parse HEAD)" "$EXPECTED_ARCH" "$BUILD_DIGEST" "$image_id" \
117- > runtime-image-proof/identity.txt
118- printf 'RUNTIME_IMAGE_ID=%s\n' "$image_id" >> "$GITHUB_ENV"
119- cat runtime-image-proof/identity.txt >> "$GITHUB_STEP_SUMMARY"
120-
121- - name: Smoke installed CLIs without provider credentials
122- shell: bash
123- run: |
124- set -euo pipefail
125- docker run --rm --network none "$RUNTIME_IMAGE_ID" /bin/sh -ec '
126- skillspector --help
127- aig-skill-scan --help
128- codex --version
129- ' 2>&1 | tee runtime-image-proof/cli-smoke.txt
88+ IMAGE_TAGS: ${{ steps.meta.outputs.tags }}
89+ BUILD_RESULT: ${{ needs.build.result }}
90+ GH_TOKEN: ${{ github.token }}
91+ run: python3 scripts/runtime-image/publish.py merge
13092
131- - name: Retain successful export and smoke evidence
93+ - name: Retain manifest identity
13294 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
13395 with:
134- name: runtime-image-proof-linux-${{ matrix.arch }}
135- path: runtime-image-proof/
96+ name: runtime-image-manifest
97+ path: runtime-image-proof/manifest.json
13698 if-no-files-found: error
13799 retention-days: 7
0 commit comments