98
98
publish-image :
99
99
runs-on : ubuntu-latest
100
100
needs : [build]
101
+ strategy :
102
+ matrix :
103
+ include :
104
+ - build-os : linux
105
+ build-arch : amd64
106
+ - build-os : linux
107
+ build-arch : arm64
108
+ - build-os : linux
109
+ build-arch : s390x
110
+ - build-os : linux
111
+ build-arch : ppc64le
101
112
steps :
102
113
- name : Checkout repository
103
114
uses : actions/checkout@v3
115
+
116
+ - name : Set up QEMU
117
+ uses : docker/setup-qemu-action@v3
118
+
119
+ - name : Set up Docker Buildx
120
+ uses : docker/setup-buildx-action@v3
121
+
104
122
- name : Log in to the container registry
105
123
uses : docker/login-action@v2
106
124
with :
@@ -110,7 +128,7 @@ jobs:
110
128
- name : download artifacts
111
129
uses : actions/download-artifact@v3
112
130
with :
113
- name : release-tars-linux-static
131
+ name : release-tars-${{ matrix.build-os }}-${{ matrix.build-arch }}
114
132
path : misc/snapshotter
115
133
- name : unpack static release
116
134
run : |
@@ -131,6 +149,29 @@ jobs:
131
149
context : misc/snapshotter
132
150
file : misc/snapshotter/Dockerfile
133
151
push : true
134
- tags : ${{ steps.meta.outputs.tags }}
152
+ platforms : ${{ matrix.build-os }}/${{ matrix.build-arch }}
153
+ tags : ${{ steps.meta.outputs.tags }}-${{ matrix.build-arch }}
135
154
labels : ${{ steps.meta.outputs.labels }}
136
155
build-args : NYDUS_VER=${{ env.NYDUS_STABLE_VER }}
156
+
157
+ publish-manifest :
158
+ runs-on : ubuntu-latest
159
+ needs : [publish-image]
160
+ steps :
161
+ - name : Log in to the container registry
162
+ uses : docker/login-action@v2
163
+ with :
164
+ registry : ${{ env.REGISTRY }}
165
+ username : ${{ github.actor }}
166
+ password : ${{ secrets.GITHUB_TOKEN }}
167
+ - name : Extract metadata (tags, labels) for Docker
168
+ id : meta
169
+ uses : docker/metadata-action@v4
170
+ with :
171
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
172
+ - name : Publish manifest for multi-arch image
173
+ run : |
174
+ docker manifest create ${{ steps.meta.outputs.tags }} \
175
+ --amend ${{ steps.meta.outputs.tags }}-amd64 --amend ${{ steps.meta.outputs.tags }}-arm64 \
176
+ --amend ${{ steps.meta.outputs.tags }}-s390x --amend ${{ steps.meta.outputs.tags }}-ppc64le
177
+ docker manifest push ${{ steps.meta.outputs.tags }}
0 commit comments