Skip to content

Commit

Permalink
Make release helper script publish multi-arch images
Browse files Browse the repository at this point in the history
We need to update the release helper script accordingly to publish
multi-arch images.

Signed-off-by: Hyounggyu Choi <[email protected]>
  • Loading branch information
BbolroC committed Jun 12, 2024
1 parent 9cbc50e commit f6947f3
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions hack/release-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,30 @@ function tag_and_push_packages() {
for staged_pkg_name in ${!staged_to_release[@]}; do
release_pkg_name=${staged_to_release[${staged_pkg_name}]}

# pull the staged package
docker pull ${ghcr_repo}/${staged_pkg_name}:${release_candidate_sha}

# set tag prefix (if needed)
release_tag_prefix=
if [[ -v staged_to_release_tag_prefix[${staged_pkg_name}] ]]; then
release_tag_prefix=${staged_to_release_tag_prefix[${staged_pkg_name}]}
fi
release_tag_full=${release_tag_prefix}${release_tag}

# tag it
docker tag ${ghcr_repo}/${staged_pkg_name}:${release_candidate_sha} ${ghcr_repo}/${release_pkg_name}:${release_tag_full}
for arch in x86_64 s390x; do
# pull the staged package
docker pull ${ghcr_repo}/${staged_pkg_name}:${release_candidate_sha}-${arch}

# tag it
docker tag ${ghcr_repo}/${staged_pkg_name}:${release_candidate_sha}-${arch} \
${ghcr_repo}/${release_pkg_name}:${release_tag_full}-${arch}

# push it (i.e. release it)
docker push ${ghcr_repo}/${release_pkg_name}:${release_tag_full}-${arch}
done

# push it (i.e. release it)
docker push ${ghcr_repo}/${release_pkg_name}:${release_tag_full}
# Publish the multi-arch manifest
docker manifest create ${ghcr_repo}/${release_pkg_name}:${release_tag_full} \
--amend ${ghcr_repo}/${release_pkg_name}:${release_tag_full}-x86_64 \
--amend ${ghcr_repo}/${release_pkg_name}:${release_tag_full}-s390x
docker manifest push ${ghcr_repo}/${release_pkg_name}:${release_tag_full}
done
}

Expand Down

0 comments on commit f6947f3

Please sign in to comment.