Skip to content

Commit

Permalink
Call set_latest_to_highest_semver after publishing a new release (#344)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Suszyński <[email protected]>
  • Loading branch information
knative-prow-robot and cardil authored Nov 9, 2023
1 parent 299918d commit 649123e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ function publish_artifacts() {
fi
[[ -n "${RELEASE_GCS_BUCKET}" ]] && publish_to_gcs "${ARTIFACTS_TO_PUBLISH}"
publish_to_github "${ARTIFACTS_TO_PUBLISH}"
set_latest_to_highest_semver
banner "New release published successfully"
}

Expand All @@ -664,12 +665,13 @@ function set_latest_to_highest_semver() {
fi

local release_id # don't combine with the line below, or $? will be 0
release_id="$(hub_tool api /repos/${ORG_NAME}/${REPO_NAME}/releases/tags/knative-${last_version} | jq .id)"
release_id="$(hub_tool api "/repos/${ORG_NAME}/${REPO_NAME}/releases/tags/knative-${last_version}" | jq .id)"
if [[ $? -ne 0 ]]; then
abort "cannot get relase id from github"
fi

hub_tool api --method PATCH /repos/knative/serving/releases/$release_id -F make_latest=true > /dev/null || abort "error settomg $last_version to 'latest'"
hub_tool api --method PATCH "/repos/knative/serving/releases/$release_id" \
-F make_latest=true > /dev/null || abort "error settomg $last_version to 'latest'"
echo "Github release ${last_version} set as 'latest'"
}

Expand Down Expand Up @@ -745,7 +747,6 @@ function main() {
done
echo "New release built successfully"
publish_artifacts
set_latest_to_highest_semver
}

# Publishes a new release on GitHub, also git tagging it (unless this is not a versioned release).
Expand Down

0 comments on commit 649123e

Please sign in to comment.