diff --git a/.github/workflows/publish-release.yaml b/.github/workflows/publish-release.yaml index f679dbd1..c51f91ca 100644 --- a/.github/workflows/publish-release.yaml +++ b/.github/workflows/publish-release.yaml @@ -151,16 +151,24 @@ jobs: # Image with multiple manifests has digest in each manifest. manifests=$(docker buildx imagetools inspect "${FINAL_IMAGE_NAME}" --raw) if grep manifests <<<"${manifests}" 2>&1 >/dev/null ; then - jq -r '.manifests[]? | .digest + " " + .platform.os + "/" + .platform.architecture' <<<"${manifests}" + jq -r '.manifests[]? | .digest + " " + .platform.os + "/" + .platform.architecture' <<<"${manifests}" \ + | while read digest platform ; do + image=${FINAL_IMAGE_NAME}@${digest} + if [[ ${BUILDX_PLATFORMS} != *"${platform}"* ]] ; then + echo "=====================================" + echo "Ignore image for non-runnable platform ${platform}" + echo " ${image}" + echo "=====================================" + continue + fi + echo "=====================================" + echo "Inspect image for platform ${platform}" + echo " ${image}" + echo "=====================================" + docker run --rm --platform ${platform} --entrypoint sh ${image} -c \ + 'apk add file > /dev/null; file /bin/kubectl; file /bin/busybox; file /addon-operator' + done else - echo $(echo -n "${manifests}" | openssl dgst -sha256 | sed s/^.stdin.*\ //) ' linux/amd64' - fi \ - | while read digest platform ; do - image=$FINAL_IMAGE_NAME@${digest} - echo "=====================================" - echo "Inspect image for platform ${platform}" - echo " ${image}" - echo "=====================================" - docker run --rm --platform ${platform} --entrypoint sh ${image} -c \ - 'apk add file > /dev/null; file /bin/kubectl; file /bin/busybox; file /addon-operator; file /bin/helm' - done + echo Not a multi-arhitecture image. + #echo $(echo -n "${manifests}" | openssl dgst -sha256) ' linux/amd64' + fi