@@ -26,6 +26,9 @@ concurrency:
2626 group : ${{ github.workflow }}-${{ github.ref }}
2727 cancel-in-progress : false
2828
29+ env :
30+ VALIDATOR_IMAGE : ghcr.io/nvidia/eidos-validator
31+
2932jobs :
3033
3134 # =============================================================================
@@ -99,13 +102,13 @@ jobs:
99102 go_version : ${{ steps.versions.outputs.go }}
100103
101104 # =============================================================================
102- # Build Job (runs after all tests pass )
105+ # Build Job: GoReleaser (binaries, ko images, draft GitHub release )
103106 # =============================================================================
104107
105108 build :
106- name : Build and Release
109+ name : Build and Release (Draft)
107110 runs-on : ubuntu-latest
108- needs : [unit, integration, e2e] # Wait for all tests to pass
111+ needs : [unit, integration, e2e]
109112 timeout-minutes : 30
110113 outputs :
111114 release_outcome : ${{ steps.release.outputs.release_outcome }}
@@ -135,14 +138,144 @@ jobs:
135138 uses : ./.github/actions/go-build-release
136139
137140 # =============================================================================
138- # Attestation Job (runs after build succeeds)
141+ # Docker Jobs: Native per-arch validator builds (parallel with GoReleaser)
142+ # =============================================================================
143+
144+ docker-amd64 :
145+ name : Docker Validator (amd64)
146+ runs-on : ubuntu-latest
147+ needs : [unit, integration, e2e]
148+ timeout-minutes : 15
149+ permissions :
150+ contents : read
151+ packages : write
152+ steps :
153+ - name : Checkout Code
154+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
155+
156+ - name : Setup Docker Buildx
157+ uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
158+
159+ - name : Authenticate to registry
160+ uses : ./.github/actions/ghcr-login
161+
162+ - name : Build and push
163+ uses : docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
164+ with :
165+ context : .
166+ file : Dockerfile.validator
167+ platforms : linux/amd64
168+ push : true
169+ tags : ${{ env.VALIDATOR_IMAGE }}:${{ github.ref_name }}-amd64
170+ labels : |
171+ org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
172+ org.opencontainers.image.title=eidos-validator
173+ org.opencontainers.image.revision=${{ github.sha }}
174+ org.opencontainers.image.version=${{ github.ref_name }}
175+ org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
176+
177+ docker-arm64 :
178+ name : Docker Validator (arm64)
179+ runs-on : ubuntu-arm64
180+ needs : [unit, integration, e2e]
181+ timeout-minutes : 15
182+ permissions :
183+ contents : read
184+ packages : write
185+ steps :
186+ - name : Checkout Code
187+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
188+
189+ - name : Setup Docker Buildx
190+ uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
191+
192+ - name : Authenticate to registry
193+ uses : ./.github/actions/ghcr-login
194+
195+ - name : Build and push
196+ uses : docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
197+ with :
198+ context : .
199+ file : Dockerfile.validator
200+ platforms : linux/arm64
201+ push : true
202+ tags : ${{ env.VALIDATOR_IMAGE }}:${{ github.ref_name }}-arm64
203+ labels : |
204+ org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
205+ org.opencontainers.image.title=eidos-validator
206+ org.opencontainers.image.revision=${{ github.sha }}
207+ org.opencontainers.image.version=${{ github.ref_name }}
208+ org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
209+
210+ # =============================================================================
211+ # Docker Manifest: Combine per-arch images into multi-arch manifests
212+ # =============================================================================
213+
214+ docker-manifest :
215+ name : Docker Manifest
216+ runs-on : ubuntu-latest
217+ needs : [docker-amd64, docker-arm64]
218+ timeout-minutes : 5
219+ permissions :
220+ contents : read
221+ packages : write
222+ steps :
223+ - name : Authenticate to registry
224+ uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
225+ with :
226+ registry : ghcr.io
227+ username : ${{ github.actor }}
228+ password : ${{ github.token }}
229+
230+ - name : Create and push manifests
231+ env :
232+ TAG : ${{ github.ref_name }}
233+ run : |
234+ set -euo pipefail
235+
236+ # Extract major and minor versions (e.g., v0.5.7 -> v0, v0.5)
237+ MAJOR="v$(echo "$TAG" | sed 's/^v//' | cut -d. -f1)"
238+ MAJOR_MINOR="v$(echo "$TAG" | sed 's/^v//' | cut -d. -f1-2)"
239+
240+ # Create and push manifest for each tag
241+ for MANIFEST_TAG in "$TAG" "$MAJOR" "$MAJOR_MINOR" "latest"; do
242+ docker manifest create "$VALIDATOR_IMAGE:$MANIFEST_TAG" \
243+ "$VALIDATOR_IMAGE:$TAG-amd64" \
244+ "$VALIDATOR_IMAGE:$TAG-arm64"
245+ docker manifest push "$VALIDATOR_IMAGE:$MANIFEST_TAG"
246+ echo "Pushed manifest: $VALIDATOR_IMAGE:$MANIFEST_TAG"
247+ done
248+
249+ # =============================================================================
250+ # Publish: Flip draft release to public after all artifacts are ready
251+ # =============================================================================
252+
253+ publish :
254+ name : Publish Release
255+ runs-on : ubuntu-latest
256+ needs : [build, docker-manifest]
257+ if : needs.build.outputs.release_outcome == 'success'
258+ timeout-minutes : 5
259+ permissions :
260+ contents : write
261+ steps :
262+ - name : Publish GitHub release
263+ env :
264+ GH_TOKEN : ${{ github.token }}
265+ run : |
266+ set -euo pipefail
267+ gh release edit "${{ github.ref_name }}" \
268+ --repo "${{ github.repository }}" \
269+ --draft=false
270+
271+ # =============================================================================
272+ # Attestation Job (runs after release is published)
139273 # =============================================================================
140274
141275 attest :
142276 name : Attest Images
143277 runs-on : ubuntu-latest
144- needs : [build]
145- if : needs.build.outputs.release_outcome == 'success'
278+ needs : [publish]
146279 timeout-minutes : 10
147280 permissions :
148281 contents : read
0 commit comments