Skip to content

Commit 56c309b

Browse files
ci: Fix oras ArtifactHub config push (#5725)
1 parent 9f70f6b commit 56c309b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

hack/release/common.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,14 @@ publishHelmChart() {
9191
yq e -i ".version = \"${version}\"" "charts/${helm_chart}/Chart.yaml"
9292

9393
cd charts
94-
[[ -s "${ah_config_file_name}" ]] && oras push "${oci_repo}/${helm_chart}:artifacthub.io" --config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml "${ah_config_file_name}:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml"
94+
if [[ -s "${ah_config_file_name}" ]]; then
95+
# ECR requires us to create an empty config file for an alternative
96+
# media type artifact push rather than /dev/null
97+
# https://github.com/aws/containers-roadmap/issues/1074
98+
temp=$(mktemp)
99+
echo {} > "${temp}"
100+
oras push "${oci_repo}/${helm_chart}:artifacthub.io" --config "${temp}:application/vnd.cncf.artifacthub.config.v1+yaml" "${ah_config_file_name}:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml"
101+
fi
95102
helm dependency update "${helm_chart}"
96103
helm lint "${helm_chart}"
97104
helm package "${helm_chart}" --version "${version}"

0 commit comments

Comments
 (0)