Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.11] 🐛 Call set_latest_to_highest_semver after publishing a new release #345

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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