diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3fa28fa9..942ffd15 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,26 +88,24 @@ jobs: architectures=("amd64" "arm64" "arm" "386") versions=("latest" "${version_arr[0]}.${version_arr[1]}" "${version}") - for arch in "${architectures[@]}"; do - for version in "${versions[@]}"; do - IMAGE="${docker_registry}/tofuutils/tenv:${version}-${arch}" - echo "Pushing image ${IMAGE} ..." - docker push ${IMAGE} + for version in "${versions[@]}"; do + manifest="${docker_registry}/tofuutils/tenv:${version}" + images="" + + for arch in "${architectures[@]}"; do + image="${docker_registry}/tofuutils/tenv:${version}-${arch}" + echo "Pushing image ${image} ..." + docker push ${image} if [ ${?} -ne 0 ]; then - echo "Failed to push image ${IMAGE}" + echo "Failed to push image ${image}" exit 1 fi + images="${image} ${images}" done - done - for version in "${versions[@]}"; do - IMAGE="${docker_registry}/tofuutils/tenv:${version}" - echo "Pushing manifest ${IMAGE} ..." - docker manifest push ${IMAGE} - if [ ${?} -ne 0 ]; then - echo "Failed to push manifest ${IMAGE}" - exit 1 - fi + docker manifest create "${manifest}" ${images} + docker manifest push "${manifest}" + done echo "All images and manifests pushed successfully to ${docker_registry}!" @@ -129,26 +127,24 @@ jobs: architectures=("amd64" "arm64" "arm" "386") versions=("latest" "${version_arr[0]}.${version_arr[1]}" "${version}") - for arch in "${architectures[@]}"; do - for version in "${versions[@]}"; do - IMAGE="${docker_registry}/tofuutils/tenv:${version}-${arch}" - echo "Pushing image ${IMAGE} ..." - docker push ${IMAGE} + for version in "${versions[@]}"; do + manifest="${docker_registry}/tofuutils/tenv:${version}" + images="" + + for arch in "${architectures[@]}"; do + image="${docker_registry}/tofuutils/tenv:${version}-${arch}" + echo "Pushing image ${image} ..." + docker push ${image} if [ ${?} -ne 0 ]; then - echo "Failed to push image ${IMAGE}" + echo "Failed to push image ${image}" exit 1 fi + images="${image} ${images}" done - done - for version in "${versions[@]}"; do - IMAGE="${docker_registry}/tofuutils/tenv:${version}" - echo "Pushing manifest ${IMAGE} ..." - docker manifest push ${IMAGE} - if [ ${?} -ne 0 ]; then - echo "Failed to push manifest ${IMAGE}" - exit 1 - fi + docker manifest create "${manifest}" ${images} + docker manifest push "${manifest}" + done echo "All images and manifests pushed successfully to ${docker_registry}!" diff --git a/.goreleaser.yml b/.goreleaser.yml index 55ed76ad..5d770a61 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -290,56 +290,6 @@ dockers: - "registry.hub.docker.com/tofuutils/tenv:{{ .Major }}.{{ .Minor }}-386" skip_push: true -docker_manifests: - - name_template: ghcr.io/tofuutils/tenv:{{ .Version }} - image_templates: - - ghcr.io/tofuutils/tenv:{{ .Version }}-amd64 - - ghcr.io/tofuutils/tenv:{{ .Version }}-arm64 - - ghcr.io/tofuutils/tenv:{{ .Version }}-arm - - ghcr.io/tofuutils/tenv:{{ .Version }}-386 - skip_push: true - - - name_template: ghcr.io/tofuutils/tenv:{{ .Major }}.{{ .Minor }} - image_templates: - - ghcr.io/tofuutils/tenv:{{ .Major }}.{{ .Minor }}-amd64 - - ghcr.io/tofuutils/tenv:{{ .Major }}.{{ .Minor }}-arm64 - - ghcr.io/tofuutils/tenv:{{ .Major }}.{{ .Minor }}-arm - - ghcr.io/tofuutils/tenv:{{ .Major }}.{{ .Minor }}-386 - skip_push: true - - - name_template: ghcr.io/tofuutils/tenv:latest - image_templates: - - ghcr.io/tofuutils/tenv:latest-amd64 - - ghcr.io/tofuutils/tenv:latest-arm64 - - ghcr.io/tofuutils/tenv:latest-arm - - ghcr.io/tofuutils/tenv:latest-386 - skip_push: true - - - name_template: registry.hub.docker.com/tofuutils/tenv:{{ .Version }} - image_templates: - - registry.hub.docker.com/tofuutils/tenv:{{ .Version }}-amd64 - - registry.hub.docker.com/tofuutils/tenv:{{ .Version }}-arm64 - - registry.hub.docker.com/tofuutils/tenv:{{ .Version }}-arm - - registry.hub.docker.com/tofuutils/tenv:{{ .Version }}-386 - skip_push: true - - - name_template: registry.hub.docker.com/tofuutils/tenv:{{ .Major }}.{{ .Minor }} - image_templates: - - registry.hub.docker.com/tofuutils/tenv:{{ .Major }}.{{ .Minor }}-amd64 - - registry.hub.docker.com/tofuutils/tenv:{{ .Major }}.{{ .Minor }}-arm64 - - registry.hub.docker.com/tofuutils/tenv:{{ .Major }}.{{ .Minor }}-arm - - registry.hub.docker.com/tofuutils/tenv:{{ .Major }}.{{ .Minor }}-386 - skip_push: true - - - name_template: registry.hub.docker.com/tofuutils/tenv:latest - image_templates: - - registry.hub.docker.com/tofuutils/tenv:latest-amd64 - - registry.hub.docker.com/tofuutils/tenv:latest-arm64 - - registry.hub.docker.com/tofuutils/tenv:latest-arm - - registry.hub.docker.com/tofuutils/tenv:latest-386 - skip_push: true - - docker_signs: - cmd: cosign env: