@@ -253,7 +253,6 @@ jobs:
253
253
subject-path : ' ${{ env.APPLICATION_NAME }}'
254
254
255
255
build-images :
256
- runs-on : ubuntu-latest
257
256
needs : [create-draft-release]
258
257
permissions :
259
258
actions : write
@@ -263,13 +262,20 @@ jobs:
263
262
id-token : write
264
263
packages : write
265
264
statuses : write
265
+ strategy :
266
+ fail-fast : false
267
+ matrix :
268
+ include :
269
+ - os : ubuntu-latest
270
+ arch : amd64
271
+ - os : ubuntu-24.04-arm
272
+ arch : arm64
273
+ runs-on : ${{ matrix.os }}
266
274
steps :
267
275
- run : " echo \" RELEASE_TAG=${GITHUB_REF#refs/tags/}\" >> $GITHUB_ENV"
268
276
- uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 https://github.com/actions/checkout/releases/tag/v5.0.0
269
277
with :
270
278
fetch-depth : ' 0'
271
- - name : Set up QEMU
272
- uses : docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 https://github.com/docker/setup-qemu-action/releases/tag/v3.6.0
273
279
- name : Set up Docker Buildx
274
280
uses : docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 https://github.com/docker/setup-buildx-action/releases/tag/v3.11.1
275
281
- name : Login to Docker Hub
@@ -289,6 +295,9 @@ jobs:
289
295
images : |
290
296
blinklabs/adder
291
297
ghcr.io/${{ github.repository }}
298
+ flavor : |
299
+ latest=false
300
+ suffix=-${{ matrix.arch }}
292
301
tags : |
293
302
# Only version, no revision
294
303
type=match,pattern=v(.*)-(.*),group=1
@@ -301,7 +310,7 @@ jobs:
301
310
uses : docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 https://github.com/docker/build-push-action/releases/tag/v6.18.0
302
311
with :
303
312
outputs : " type=registry,push=true"
304
- platforms : linux/amd64,linux/arm64
313
+ platforms : linux/${{ matrix.arch }}
305
314
tags : ${{ steps.meta.outputs.tags }}
306
315
labels : ${{ steps.meta.outputs.labels }}
307
316
- name : Attest Docker Hub image
@@ -316,6 +325,52 @@ jobs:
316
325
subject-name : ghcr.io/${{ github.repository }}
317
326
subject-digest : ${{ steps.push.outputs.digest }}
318
327
push-to-registry : true
328
+
329
+ build-image-manifest :
330
+ needs : [build-images]
331
+ permissions :
332
+ contents : read
333
+ packages : write
334
+ runs-on : ubuntu-latest
335
+ steps :
336
+ - name : Login to Docker Hub
337
+ uses : docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 https://github.com/docker/login-action/releases/tag/v3.5.0
338
+ with :
339
+ username : blinklabs
340
+ password : ${{ secrets.DOCKER_PASSWORD }} # uses token
341
+ - name : Login to GHCR
342
+ uses : docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0 https://github.com/docker/login-action/releases/tag/v3.5.0
343
+ with :
344
+ username : ${{ github.repository_owner }}
345
+ password : ${{ secrets.GITHUB_TOKEN }}
346
+ registry : ghcr.io
347
+ - id : meta
348
+ uses : docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0 https://github.com/docker/metadata-action/releases/tag/v5.8.0
349
+ with :
350
+ images : |
351
+ blinklabs/adder
352
+ ghcr.io/${{ github.repository }}
353
+ flavor : |
354
+ latest=false
355
+ tags : |
356
+ # Only version, no revision
357
+ type=match,pattern=v(.*)-(.*),group=1
358
+ # branch
359
+ type=ref,event=branch
360
+ # semver
361
+ type=semver,pattern={{version}}
362
+ - name : manifest-create
363
+ shell : bash
364
+ run : |
365
+ for t in `echo '${{ steps.meta.outputs.tags }}'`; do
366
+ # Extract the underlying manifests from each manifests list and create a new single manifest list
367
+ docker manifest create ${t} \
368
+ $(docker manifest inspect ${t}-amd64 | jq -r '.manifests[] | .digest' | sed -e "s|^|${t%:*}@|") \
369
+ $(docker manifest inspect ${t}-arm64 | jq -r '.manifests[] | .digest' | sed -e "s|^|${t%:*}@|")
370
+ docker manifest push ${t}
371
+ done
372
+ # Checkout repo so README.md is available for next step
373
+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 https://github.com/actions/checkout/releases/tag/v5.0.0
319
374
# Update Docker Hub from README
320
375
- name : Docker Hub Description
321
376
uses : peter-evans/dockerhub-description@432a30c9e07499fd01da9f8a49f0faf9e0ca5b77 # v4.0.2 https://github.com/peter-evans/dockerhub-description/releases/tag/v4.0.2
@@ -330,7 +385,7 @@ jobs:
330
385
runs-on : ubuntu-latest
331
386
permissions :
332
387
contents : write
333
- needs : [create-draft-release, build-binaries, build-images]
388
+ needs : [create-draft-release, build-binaries, build-images, build-image-manifest ]
334
389
steps :
335
390
- uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 https://github.com/actions/github-script/releases/tag/v7.0.1
336
391
if : startsWith(github.ref, 'refs/tags/')
0 commit comments