@@ -253,6 +253,11 @@ jobs:
253
253
with :
254
254
name : dist
255
255
256
+ - name : Define Platform Suffix
257
+ id : platform
258
+ run : |
259
+ echo "suffix=${{ matrix.platform == 'linux/amd64' && 'linux-amd64' || 'linux-arm64' }}" >> $GITHUB_OUTPUT
260
+
256
261
- name : Set up Docker Buildx
257
262
uses : docker/setup-buildx-action@v3
258
263
@@ -270,10 +275,17 @@ jobs:
270
275
file : ./dev/docker/ci/${{ matrix.container.distro }}.dockerfile
271
276
push : ${{ github.event_name != 'pull_request' }}
272
277
platforms : ${{ matrix.platform }}
273
- tags : aminya/${{ matrix.container.image }}:${{ matrix.container.tag }},aminya/ ${{ matrix.container.image }}:latest
278
+ tags : aminya/${{ matrix.container.image }}:${{ matrix.container.tag }}- ${{ steps.platform.outputs.suffix }}
274
279
cache-from : type=registry,ref=aminya/${{ matrix.container.image }}:latest
275
280
cache-to : type=inline
276
281
282
+ - name : Tag latest locally
283
+ run : docker tag aminya/${{ matrix.container.image }}:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}:latest
284
+
285
+ - name : Push latest to Docker Hub
286
+ if : ${{ github.event_name != 'pull_request' && matrix.container.distro != 'ubuntu' }}
287
+ run : docker push aminya/${{ matrix.container.image }}:latest
288
+
277
289
- name : Docker Readme for setup-cpp-${{matrix.container.distro }}
278
290
if : ${{ github.event_name != 'pull_request' }}
279
291
uses : peter-evans/dockerhub-description@v4
@@ -290,10 +302,17 @@ jobs:
290
302
file : ./dev/docker/ci/${{ matrix.container.distro }}-llvm.dockerfile
291
303
push : ${{ github.event_name != 'pull_request' }}
292
304
platforms : ${{ matrix.platform }}
293
- tags : aminya/${{ matrix.container.image }}-llvm:${{ matrix.container.tag }},aminya/ ${{ matrix.container.image }}-llvm:latest
305
+ tags : aminya/${{ matrix.container.image }}-llvm:${{ matrix.container.tag }}- ${{ steps.platform.outputs.suffix }}
294
306
cache-from : type=registry,ref=aminya/${{ matrix.container.image }}-llvm:latest
295
307
cache-to : type=inline
296
308
309
+ - name : Tag latest locally
310
+ run : docker tag aminya/${{ matrix.container.image }}-llvm:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}-llvm:latest
311
+
312
+ - name : Push latest to Docker Hub
313
+ if : ${{ github.event_name != 'pull_request' && matrix.container.distro != 'ubuntu' }}
314
+ run : docker push aminya/${{ matrix.container.image }}-llvm:latest
315
+
297
316
- name : Docker Readme for setup-cpp-${{matrix.container.distro }}-llvm
298
317
if : ${{ github.event_name != 'pull_request' }}
299
318
uses : peter-evans/dockerhub-description@v4
@@ -320,10 +339,17 @@ jobs:
320
339
file : ./dev/docker/ci/${{ matrix.container.distro }}-gcc.dockerfile
321
340
push : ${{ github.event_name != 'pull_request' }}
322
341
platforms : ${{ matrix.platform }}
323
- tags : aminya/${{ matrix.container.image }}-gcc:${{ matrix.container.tag }},aminya/ ${{ matrix.container.image }}-gcc:latest
342
+ tags : aminya/${{ matrix.container.image }}-gcc:${{ matrix.container.tag }}- ${{ steps.platform.outputs.suffix }}
324
343
cache-from : type=registry,ref=aminya/${{ matrix.container.image }}-gcc:latest
325
344
cache-to : type=inline
326
345
346
+ - name : Tag latest locally
347
+ run : docker tag aminya/${{ matrix.container.image }}-gcc:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}-gcc:latest
348
+
349
+ - name : Push latest to Docker Hub
350
+ if : ${{ github.event_name != 'pull_request' && matrix.container.distro != 'ubuntu' }}
351
+ run : docker push aminya/${{ matrix.container.image }}-gcc:latest
352
+
327
353
- name : Docker Readme for setup-cpp-${{matrix.container.distro }}-gcc
328
354
if : ${{ github.event_name != 'pull_request' }}
329
355
uses : peter-evans/dockerhub-description@v4
@@ -351,10 +377,17 @@ jobs:
351
377
file : ./dev/docker/ci/${{ matrix.container.distro }}-mingw.dockerfile
352
378
push : ${{ github.event_name != 'pull_request' }}
353
379
platforms : ${{ matrix.platform }}
354
- tags : aminya/${{ matrix.container.image }}-mingw:${{ matrix.container.tag }},aminya/ ${{ matrix.container.image }}-mingw:latest
380
+ tags : aminya/${{ matrix.container.image }}-mingw:${{ matrix.container.tag }}- ${{ steps.platform.outputs.suffix }}
355
381
cache-from : type=registry,ref=aminya/${{ matrix.container.image }}-mingw:latest
356
382
cache-to : type=inline
357
383
384
+ - name : Tag latest locally
385
+ run : docker tag aminya/${{ matrix.container.image }}-mingw:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}-mingw:latest
386
+
387
+ - name : Push latest to Docker Hub
388
+ if : ${{ github.event_name != 'pull_request' && matrix.container.distro != 'ubuntu' }}
389
+ run : docker push aminya/${{ matrix.container.image }}-mingw:latest
390
+
358
391
- name : Docker Readme for setup-cpp-${{matrix.container.distro }}-mingw
359
392
if : ${{ github.event_name != 'pull_request' && matrix.container.distro != 'fedora' }}
360
393
uses : peter-evans/dockerhub-description@v4
@@ -374,6 +407,48 @@ jobs:
374
407
platforms : ${{ matrix.platform }}
375
408
tags : aminya/test-${{ matrix.container.image }}-mingw:${{ matrix.container.tag }}
376
409
410
+ Docker-Manifest :
411
+ needs : [Docker]
412
+ runs-on : ubuntu-24.04
413
+ if : ${{ github.event_name != 'pull_request' }}
414
+ steps :
415
+ - name : Set up Docker Buildx
416
+ uses : docker/setup-buildx-action@v3
417
+
418
+ - name : Login to Docker Hub
419
+ uses : docker/login-action@v3
420
+ with :
421
+ username : aminya
422
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
423
+
424
+ - name : Enable experimental features
425
+ run : |
426
+ mkdir -p ~/.docker
427
+ echo '{"experimental": "enabled"}' > ~/.docker/config.json
428
+
429
+ - name : Create and push multi-arch manifests
430
+ run : |
431
+ TAG="22.04-1.1.1"
432
+ DISTRO="ubuntu"
433
+
434
+ # Create and push manifests for each variant
435
+ VARIANTS=("" "-llvm" "-gcc" "-mingw")
436
+ for VARIANT in "${VARIANTS[@]}"; do
437
+ echo "Creating manifest for setup-cpp-$DISTRO$VARIANT"
438
+
439
+ # Create versioned manifest
440
+ docker manifest create "aminya/setup-cpp-$DISTRO$VARIANT:$TAG" \
441
+ "aminya/setup-cpp-$DISTRO$VARIANT:$TAG-linux-amd64" \
442
+ "aminya/setup-cpp-$DISTRO$VARIANT:$TAG-linux-arm64"
443
+ docker manifest push "aminya/setup-cpp-$DISTRO$VARIANT:$TAG"
444
+
445
+ # Create latest manifest
446
+ docker manifest create "aminya/setup-cpp-$DISTRO$VARIANT:latest" \
447
+ "aminya/setup-cpp-$DISTRO$VARIANT:$TAG-linux-amd64" \
448
+ "aminya/setup-cpp-$DISTRO$VARIANT:$TAG-linux-arm64"
449
+ docker manifest push "aminya/setup-cpp-$DISTRO$VARIANT:latest"
450
+ done
451
+
377
452
Release :
378
453
if : startsWith(github.ref, 'refs/tags/')
379
454
needs : [Build, BuildExecutable, Test]
0 commit comments