Skip to content

Commit 97455e5

Browse files
committed
feat(multi-arch): combine architecture specific images into a multi-arch manifest
1 parent 85f44ef commit 97455e5

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

.github/workflows/release.yaml

+22-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ concurrency:
1111
group: ${{ github.workflow }}-${{ github.ref }}
1212
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1313

14+
env:
15+
image_name: template-github-release
16+
1417
jobs:
1518
release:
1619
name: Create Release
@@ -58,7 +61,7 @@ jobs:
5861
id: meta
5962
uses: docker/metadata-action@v4
6063
with:
61-
images: ghcr.io/kong/template-github-release
64+
images: ghcr.io/kong/${{ env.image_name }}
6265
sep-tags: ' '
6366
flavor: |
6467
suffix=-${{ matrix.architecture }}-${{ matrix.ostype }}
@@ -71,7 +74,7 @@ jobs:
7174
if: ${{ needs.release.outputs.published == 'true' }}
7275
run: |
7376
for tag in ${{ steps.meta.outputs.tags }}; do \
74-
docker tag ghcr.io/template-github-release:build-$ARCHITECTURE-$OSTYPE $tag && \
77+
docker tag ghcr.io/${{ env.image_name }}:build-$ARCHITECTURE-$OSTYPE $tag && \
7578
docker push $tag; \
7679
done
7780
- name: Archive the package
@@ -84,3 +87,20 @@ jobs:
8487
with:
8588
tag_name: ${{ needs.release.outputs.release-git-tag }}
8689
files: ${{ matrix.architecture }}-${{ matrix.ostype }}.tar.gz
90+
91+
multi-arch:
92+
needs: artifacts
93+
name: Create Release Artifacts
94+
strategy:
95+
matrix:
96+
ostype: [linux-gnu, linux-musl]
97+
runs-on: ubuntu-latest
98+
steps:
99+
- name: Combine per architecture images into a single multi-arch manifest
100+
run: |
101+
docker pull ghcr.io/kong/${{ env.image_name }}:${{ needs.release.outputs.release-git-tag }}-aarch64-${{ matrix.ostype }}
102+
docker pull ghcr.io/kong/${{ env.image_name }}:${{ needs.release.outputs.release-git-tag }}-x86_64-${{ matrix.ostype }}
103+
docker manifest ghcr.io/kong/${{ env.image_name }}:${{ needs.release.outputs.release-git-tag }}-${{ matrix.ostype }} \
104+
ghcr.io/kong/${{ env.image_name }}:${{ needs.release.outputs.release-git-tag }}-aarch64-${{ matrix.ostype }} \
105+
ghcr.io/kong/${{ env.image_name }}:${{ needs.release.outputs.release-git-tag }}-x86_64-${{ matrix.ostype }}
106+
ghcr.io/kong/${{ env.image_name }}:${{ needs.release.outputs.release-git-tag }}-${{ matrix.ostype }}

0 commit comments

Comments
 (0)