Skip to content

Commit 1837c0d

Browse files
authored
Merge pull request #381 from aminya/docker-versions
ci: add docker tags with the base platform versions
2 parents be9dd53 + 83d70f9 commit 1837c0d

File tree

3 files changed

+155
-94
lines changed

3 files changed

+155
-94
lines changed

.github/workflows/CI.yml

Lines changed: 71 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ concurrency:
1212

1313
env:
1414
NODE_OPTIONS: --enable-source-maps
15+
version: "1.3.0"
1516

1617
jobs:
1718
Build:
@@ -239,25 +240,25 @@ jobs:
239240
platform:
240241
- linux/amd64
241242
container:
242-
- { distro: "ubuntu", image: "setup-cpp-ubuntu", BASE_VERSION: "24.04", tag: "24.04-1.3.0" }
243-
- { distro: "ubuntu", image: "setup-cpp-ubuntu", BASE_VERSION: "22.04", tag: "22.04-1.3.0" }
244-
- { distro: "ubuntu", image: "setup-cpp-ubuntu", BASE_VERSION: "20.04", tag: "20.04-1.3.0" }
245-
- { distro: "fedora", image: "setup-cpp-fedora", tag: "40-1.3.0" }
246-
- { distro: "arch", image: "setup-cpp-arch", tag: "base-1.3.0" }
247-
- { distro: "alpine", image: "setup-cpp-alpine", BASE_VERSION: "22-alpine3.21", tag: "3.21-1.3.0" }
243+
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "24.04" }
244+
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "22.04" }
245+
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "20.04" }
246+
- { distro: "fedora", image: "setup-cpp-fedora", tag: "40" }
247+
- { distro: "arch", image: "setup-cpp-arch", tag: "base" }
248+
- { distro: "alpine", image: "setup-cpp-alpine", tag: "3.21", base_version: "22-alpine3.21" }
248249
include:
249250
- os: ubuntu-24.04-arm
250251
platform: linux/arm64
251-
container: { distro: "ubuntu", image: "setup-cpp-ubuntu", BASE_VERSION: "24.04", tag: "24.04-1.3.0" }
252+
container: { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "24.04" }
252253
- os: ubuntu-24.04-arm
253254
platform: linux/arm64
254-
container: { distro: "ubuntu", image: "setup-cpp-ubuntu", BASE_VERSION: "22.04", tag: "22.04-1.3.0" }
255+
container: { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "22.04" }
255256
- os: ubuntu-24.04-arm
256257
platform: linux/arm64
257-
container: { distro: "ubuntu", image: "setup-cpp-ubuntu", BASE_VERSION: "20.04", tag: "20.04-1.3.0" }
258+
container: { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "20.04" }
258259
- os: ubuntu-24.04-arm
259260
platform: linux/arm64
260-
container: { distro: "alpine", image: "setup-cpp-alpine", BASE_VERSION: "22-alpine3.21", tag: "3.21-1.3.0" }
261+
container: { distro: "alpine", image: "setup-cpp-alpine", tag: "3.21", base_version: "22-alpine3.21" }
261262
steps:
262263
- uses: actions/checkout@v4
263264
with:
@@ -294,18 +295,21 @@ jobs:
294295
load: true
295296
provenance: false
296297
platforms: ${{ matrix.platform }}
297-
tags: aminya/${{ matrix.container.image }}:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }}
298-
cache-from: type=registry,ref=aminya/${{ matrix.container.image }}:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }}
298+
tags: aminya/${{ matrix.container.image }}:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }}
299+
cache-from: type=registry,ref=aminya/${{ matrix.container.image }}:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }}
299300
cache-to: type=inline
300-
build-args: BASE_VERSION=${{ matrix.container.BASE_VERSION || '' }}
301+
build-args: BASE_VERSION=${{ matrix.container.base_version || matrix.container.tag }}
301302

302303
- name: Tag latest locally
303304
run: |
304-
docker tag aminya/${{ matrix.container.image }}:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}:latest
305+
docker tag aminya/${{ matrix.container.image }}:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}:latest
306+
docker tag aminya/${{ matrix.container.image }}:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}:${{ matrix.container.tag }}
305307
306308
- name: Push latest to Docker Hub
307309
if: ${{ github.event_name != 'pull_request' && matrix.container.distro != 'ubuntu' && matrix.container.distro != 'alpine' }}
308-
run: docker push aminya/${{ matrix.container.image }}:latest
310+
run: |
311+
docker push aminya/${{ matrix.container.image }}:latest
312+
docker push aminya/${{ matrix.container.image }}:${{ matrix.container.tag }}
309313
310314
- name: Docker Readme for setup-cpp-${{matrix.container.distro }}
311315
if: ${{ github.event_name != 'pull_request' || contains(github.event.head_commit.message, '[push docker]') }}
@@ -326,17 +330,20 @@ jobs:
326330
load: true
327331
provenance: false
328332
platforms: ${{ matrix.platform }}
329-
tags: aminya/${{ matrix.container.image }}-llvm:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }}
330-
cache-from: type=registry,ref=aminya/${{ matrix.container.image }}-llvm:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }}
333+
tags: aminya/${{ matrix.container.image }}-llvm:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }}
334+
cache-from: type=registry,ref=aminya/${{ matrix.container.image }}-llvm:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }}
331335
cache-to: type=inline
332336

333337
- name: Tag latest locally
334338
run: |
335-
docker tag aminya/${{ matrix.container.image }}-llvm:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}-llvm:latest
339+
docker tag aminya/${{ matrix.container.image }}-llvm:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}-llvm:latest
340+
docker tag aminya/${{ matrix.container.image }}-llvm:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}-llvm:${{ matrix.container.tag }}
336341
337342
- name: Push latest to Docker Hub
338343
if: ${{ github.event_name != 'pull_request' && matrix.container.distro != 'ubuntu' && matrix.container.distro != 'alpine' }}
339-
run: docker push aminya/${{ matrix.container.image }}-llvm:latest
344+
run: |
345+
docker push aminya/${{ matrix.container.image }}-llvm:latest
346+
docker push aminya/${{ matrix.container.image }}-llvm:${{ matrix.container.tag }}
340347
341348
- name: Docker Readme for setup-cpp-${{matrix.container.distro }}-llvm
342349
if: ${{ github.event_name != 'pull_request' || contains(github.event.head_commit.message, '[push docker]') }}
@@ -355,7 +362,7 @@ jobs:
355362
file: ./dev/docker/examples/${{ matrix.container.distro }}-llvm.dockerfile
356363
push: false
357364
platforms: ${{ matrix.platform }}
358-
tags: aminya/test-${{ matrix.container.image }}-llvm:${{ matrix.container.tag }}
365+
tags: aminya/test-${{ matrix.container.image }}-llvm:${{ matrix.container.tag }}-${{ env.version }}
359366

360367
- name: Build setup-cpp-${{matrix.container.distro }}-gcc
361368
id: build_gcc
@@ -367,17 +374,20 @@ jobs:
367374
load: true
368375
provenance: false
369376
platforms: ${{ matrix.platform }}
370-
tags: aminya/${{ matrix.container.image }}-gcc:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }}
371-
cache-from: type=registry,ref=aminya/${{ matrix.container.image }}-gcc:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }}
377+
tags: aminya/${{ matrix.container.image }}-gcc:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }}
378+
cache-from: type=registry,ref=aminya/${{ matrix.container.image }}-gcc:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }}
372379
cache-to: type=inline
373380

374381
- name: Tag latest locally
375382
run: |
376-
docker tag aminya/${{ matrix.container.image }}-gcc:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}-gcc:latest
383+
docker tag aminya/${{ matrix.container.image }}-gcc:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}-gcc:latest
384+
docker tag aminya/${{ matrix.container.image }}-gcc:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}-gcc:${{ matrix.container.tag }}
377385
378386
- name: Push latest to Docker Hub
379387
if: ${{ github.event_name != 'pull_request' && matrix.container.distro != 'ubuntu' && matrix.container.distro != 'alpine' }}
380-
run: docker push aminya/${{ matrix.container.image }}-gcc:latest
388+
run: |
389+
docker push aminya/${{ matrix.container.image }}-gcc:latest
390+
docker push aminya/${{ matrix.container.image }}-gcc:${{ matrix.container.tag }}
381391
382392
- name: Docker Readme for setup-cpp-${{matrix.container.distro }}-gcc
383393
if: ${{ github.event_name != 'pull_request' || contains(github.event.head_commit.message, '[push docker]') }}
@@ -396,7 +406,7 @@ jobs:
396406
file: ./dev/docker/examples/${{ matrix.container.distro }}-gcc.dockerfile
397407
push: false
398408
platforms: ${{ matrix.platform }}
399-
tags: aminya/test-${{ matrix.container.image }}-gcc:${{ matrix.container.tag }}
409+
tags: aminya/test-${{ matrix.container.image }}-gcc:${{ matrix.container.tag }}-${{ env.version }}
400410

401411
- name: Build setup-cpp-${{matrix.container.distro }}-mingw
402412
id: build_mingw
@@ -409,18 +419,20 @@ jobs:
409419
load: true
410420
provenance: false
411421
platforms: ${{ matrix.platform }}
412-
tags: aminya/${{ matrix.container.image }}-mingw:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }}
413-
cache-from: type=registry,ref=aminya/${{ matrix.container.image }}-mingw:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }}
422+
tags: aminya/${{ matrix.container.image }}-mingw:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }}
423+
cache-from: type=registry,ref=aminya/${{ matrix.container.image }}-mingw:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }}
414424
cache-to: type=inline
415425

416426
- name: Tag latest locally
417427
if: ${{ matrix.container.distro != 'fedora' && !(matrix.container.distro == 'alpine' && matrix.platform == 'linux/arm64') }}
418428
run: |
419-
docker tag aminya/${{ matrix.container.image }}-mingw:${{ matrix.container.tag }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}-mingw:latest
420-
429+
docker tag aminya/${{ matrix.container.image }}-mingw:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}-mingw:latest
430+
docker tag aminya/${{ matrix.container.image }}-mingw:${{ matrix.container.tag }}-${{ env.version }}-${{ steps.platform.outputs.suffix }} aminya/${{ matrix.container.image }}-mingw:${{ matrix.container.tag }}
421431
- name: Push latest to Docker Hub
422432
if: ${{ github.event_name != 'pull_request' && matrix.container.distro != 'ubuntu' && matrix.container.distro != 'fedora' && matrix.container.distro != 'alpine' }}
423-
run: docker push aminya/${{ matrix.container.image }}-mingw:latest
433+
run: |
434+
docker push aminya/${{ matrix.container.image }}-mingw:latest
435+
docker push aminya/${{ matrix.container.image }}-mingw:${{ matrix.container.tag }}
424436
425437
- name: Docker Readme for setup-cpp-${{matrix.container.distro }}-mingw
426438
if: ${{ github.event_name != 'pull_request' && matrix.container.distro != 'fedora' && !(matrix.container.distro == 'alpine' && matrix.platform == 'linux/arm64') }}
@@ -439,7 +451,7 @@ jobs:
439451
file: ./dev/docker/examples/${{ matrix.container.distro }}-mingw.dockerfile
440452
push: false
441453
platforms: ${{ matrix.platform }}
442-
tags: aminya/test-${{ matrix.container.image }}-mingw:${{ matrix.container.tag }}
454+
tags: aminya/test-${{ matrix.container.image }}-mingw:${{ matrix.container.tag }}-${{ env.version }}
443455

444456
Docker-Manifest:
445457
needs: [Docker]
@@ -449,25 +461,25 @@ jobs:
449461
fail-fast: false
450462
matrix:
451463
container:
452-
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "20.04-1.3.0", suffix: "", latest: false }
453-
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "20.04-1.3.0", suffix: "-llvm", latest: false }
454-
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "20.04-1.3.0", suffix: "-gcc", latest: false }
455-
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "20.04-1.3.0", suffix: "-mingw", latest: false }
456-
457-
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "22.04-1.3.0", suffix: "", latest: false }
458-
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "22.04-1.3.0", suffix: "-llvm", latest: false }
459-
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "22.04-1.3.0", suffix: "-gcc", latest: false }
460-
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "22.04-1.3.0", suffix: "-mingw", latest: false }
461-
462-
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "24.04-1.3.0", suffix: "", latest: true }
463-
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "24.04-1.3.0", suffix: "-llvm", latest: true }
464-
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "24.04-1.3.0", suffix: "-gcc", latest: true }
465-
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "24.04-1.3.0", suffix: "-mingw", latest: true }
466-
467-
- { distro: "alpine", image: "setup-cpp-alpine", tag: "3.21-1.3.0", suffix: "", latest: true }
468-
- { distro: "alpine", image: "setup-cpp-alpine", tag: "3.21-1.3.0", suffix: "-llvm", latest: true }
469-
- { distro: "alpine", image: "setup-cpp-alpine", tag: "3.21-1.3.0", suffix: "-gcc", latest: true }
470-
- { distro: "alpine", image: "setup-cpp-alpine", tag: "3.21-1.3.0", suffix: "-mingw", latest: true }
464+
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "20.04", suffix: "", latest: false }
465+
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "20.04", suffix: "-llvm", latest: false }
466+
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "20.04", suffix: "-gcc", latest: false }
467+
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "20.04", suffix: "-mingw", latest: false }
468+
469+
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "22.04", suffix: "", latest: false }
470+
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "22.04", suffix: "-llvm", latest: false }
471+
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "22.04", suffix: "-gcc", latest: false }
472+
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "22.04", suffix: "-mingw", latest: false }
473+
474+
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "24.04", suffix: "", latest: true }
475+
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "24.04", suffix: "-llvm", latest: true }
476+
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "24.04", suffix: "-gcc", latest: true }
477+
- { distro: "ubuntu", image: "setup-cpp-ubuntu", tag: "24.04", suffix: "-mingw", latest: true }
478+
479+
- { distro: "alpine", image: "setup-cpp-alpine", tag: "3.21", suffix: "", latest: true }
480+
- { distro: "alpine", image: "setup-cpp-alpine", tag: "3.21", suffix: "-llvm", latest: true }
481+
- { distro: "alpine", image: "setup-cpp-alpine", tag: "3.21", suffix: "-gcc", latest: true }
482+
- { distro: "alpine", image: "setup-cpp-alpine", tag: "3.21", suffix: "-mingw", latest: true }
471483
steps:
472484
- name: Set up Docker Buildx
473485
uses: docker/setup-buildx-action@v3
@@ -478,18 +490,25 @@ jobs:
478490
username: aminya
479491
password: ${{ secrets.DOCKERHUB_TOKEN }}
480492

493+
- uses: Noelware/docker-manifest-action@0.4.3
494+
with:
495+
inputs: aminya/${{ matrix.container.image }}${{ matrix.container.suffix }}:${{ matrix.container.tag }}-${{ env.version }}
496+
images: aminya/${{ matrix.container.image }}${{ matrix.container.suffix }}:${{ matrix.container.tag }}-${{ env.version }}-amd64,aminya/${{ matrix.container.image }}${{ matrix.container.suffix }}:${{ matrix.container.tag }}-${{ env.version }}-arm64
497+
push: true
498+
amend: true
499+
481500
- uses: Noelware/docker-manifest-action@0.4.3
482501
with:
483502
inputs: aminya/${{ matrix.container.image }}${{ matrix.container.suffix }}:${{ matrix.container.tag }}
484-
images: aminya/${{ matrix.container.image }}${{ matrix.container.suffix }}:${{ matrix.container.tag }}-amd64,aminya/${{ matrix.container.image }}${{ matrix.container.suffix }}:${{ matrix.container.tag }}-arm64
503+
images: aminya/${{ matrix.container.image }}${{ matrix.container.suffix }}:${{ matrix.container.tag }}-${{ env.version }}-amd64,aminya/${{ matrix.container.image }}${{ matrix.container.suffix }}:${{ matrix.container.tag }}-${{ env.version }}-arm64
485504
push: true
486505
amend: true
487506

488507
- uses: Noelware/docker-manifest-action@0.4.3
489508
if: ${{ matrix.container.latest }}
490509
with:
491510
inputs: aminya/${{ matrix.container.image }}${{ matrix.container.suffix }}:latest
492-
images: aminya/${{ matrix.container.image }}${{ matrix.container.suffix }}:${{ matrix.container.tag }}-amd64,aminya/${{ matrix.container.image }}${{ matrix.container.suffix }}:${{ matrix.container.tag }}-arm64
511+
images: aminya/${{ matrix.container.image }}${{ matrix.container.suffix }}:${{ matrix.container.tag }}-${{ env.version }}-amd64,aminya/${{ matrix.container.image }}${{ matrix.container.suffix }}:${{ matrix.container.tag }}-${{ env.version }}-arm64
493512
push: true
494513
amend: true
495514

0 commit comments

Comments
 (0)