Skip to content

Commit c7841c7

Browse files
authored
Merge pull request #585 from BbolroC/fix-multiple-tags
action: publish manifest for multiple tags
2 parents 81119b8 + e707fd1 commit c7841c7

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/release.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,16 @@ jobs:
144144
echo "NYDUS_STABLE_VER=$NYDUS_STABLE_VER" >> "$GITHUB_ENV"
145145
printf 'nydus version is: %s\n' "$NYDUS_STABLE_VER"
146146
- name: build and push nydus-snapshotter image
147-
uses: docker/build-push-action@v3
147+
uses: docker/build-push-action@v5
148148
with:
149149
context: misc/snapshotter
150150
file: misc/snapshotter/Dockerfile
151151
push: true
152152
platforms: ${{ matrix.build-os }}/${{ matrix.build-arch }}
153-
tags: ${{ steps.meta.outputs.tags }}-${{ matrix.build-arch }}
153+
provenance: false
154+
tags: |
155+
${{ fromJSON(steps.meta.outputs.json).tags[0] }}-${{ matrix.build-arch }}
156+
${{ fromJSON(steps.meta.outputs.json).tags[1] }}-${{ matrix.build-arch }}
154157
labels: ${{ steps.meta.outputs.labels }}
155158
build-args: NYDUS_VER=${{ env.NYDUS_STABLE_VER }}
156159

@@ -171,7 +174,12 @@ jobs:
171174
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
172175
- name: Publish manifest for multi-arch image
173176
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 }}
177+
IFS=',' read -ra tags <<< "$(echo "${{ steps.meta.outputs.tags }}" | tr '\n' ',')"
178+
for tag in "${tags[@]}"; do
179+
docker manifest create "${tag}" \
180+
--amend "${tag}-amd64" \
181+
--amend "${tag}-arm64" \
182+
--amend "${tag}-s390x" \
183+
--amend "${tag}-ppc64le"
184+
docker manifest push "${tag}"
185+
done

0 commit comments

Comments
 (0)