Skip to content

Commit

Permalink
Fix oras ArtifactHub config push
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis committed Feb 24, 2024
1 parent 8fa6a51 commit 1f07b80
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hack/release/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ build() {
commit_sha="${4}"

date_epoch="$(dateEpoch)"
build_date="$(buildDate "${date_epoch}")"
build_date="$(buildDate)"

img="$(GOFLAGS=${GOFLAGS:-} SOURCE_DATE_EPOCH="${date_epoch}" KO_DATA_DATE_EPOCH="${date_epoch}" KO_DOCKER_REPO="${oci_repo}" ko publish -B -t "${version}" ./cmd/controller)"
img_repo="$(echo "${img}" | cut -d "@" -f 1 | cut -d ":" -f 1)"
Expand Down Expand Up @@ -91,7 +91,11 @@ publishHelmChart() {
yq e -i ".version = \"${version}\"" "charts/${helm_chart}/Chart.yaml"

cd charts
[[ -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"
if [[ -s "${ah_config_file_name}" ]]; then
temp=$(mktemp)
echo {} > "${temp}"
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"
fi
helm dependency update "${helm_chart}"
helm lint "${helm_chart}"
helm package "${helm_chart}" --version "${version}"
Expand Down Expand Up @@ -119,11 +123,7 @@ dateEpoch() {
}

buildDate() {
local date_epoch

date_epoch="${1}"

date -u --date="@${date_epoch}" "+%Y-%m-%dT%H:%M:%SZ" 2>/dev/null
date -u -r "$(git log -1 --format='%ct')" "+%Y-%m-%dT%H:%M:%SZ"
}

prepareWebsite() {
Expand Down

0 comments on commit 1f07b80

Please sign in to comment.