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

chore: support specify release version #3994

Merged
merged 1 commit into from
Jun 28, 2023
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
27 changes: 25 additions & 2 deletions .github/utils/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,32 @@ get_next_available_tag() {
RELEASE_VERSION="${tag_type}${index}"
}

check_release_version(){
TMP_TAG_NAME=""
for content in $(echo "$CONTENT"); do
if [[ "$content" == "v"*"."* || "$content" == *"."* ]]; then
TMP_TAG_NAME=$content
fi
if [[ -n "$TMP_TAG_NAME" ]]; then
TMP_BRANCH_NAME="release-${TMP_TAG_NAME/v/}"
branch_url=$GITHUB_API/repos/$LATEST_REPO/branches/$TMP_BRANCH_NAME
branch_info=$( gh_curl -s $branch_url | (grep $TMP_BRANCH_NAME || true) )
if [[ -n "$branch_info" ]]; then
BRANCH_NAME=$TMP_BRANCH_NAME
TAG_NAME=$TMP_TAG_NAME
fi
break
fi
done
}

release_next_available_tag() {
check_release_version
dispatches_url=$1
v_major_minor="v$TAG_NAME"
v_major_minor="$TAG_NAME"
if [[ "$TAG_NAME" != "v"* ]]; then
v_major_minor="v$TAG_NAME"
fi
stable_type="$v_major_minor."
get_next_available_tag $stable_type
v_number=$RELEASE_VERSION
Expand All @@ -371,7 +394,7 @@ release_next_available_tag() {

usage_message() {
curl -H "Content-Type: application/json" -X POST $BOT_WEBHOOK \
-d '{"msg_type":"post","content":{"post":{"zh_cn":{"title":"Usage:","content":[[{"tag":"text","text":"please enter the correct format\n"},{"tag":"text","text":"1. do <alpha|beta|rc|stable> release\n"},{"tag":"text","text":"2. {\"ref\":\"<ref_branch>\",\"inputs\":{\"release_version\":\"<release_version>\"}}"}]]}}}}'
-d '{"msg_type":"post","content":{"post":{"zh_cn":{"title":"Usage:","content":[[{"tag":"text","text":"please enter the correct format\n"},{"tag":"text","text":"1. do [v*.*] <alpha|beta|rc> release\n"},{"tag":"text","text":"2. {\"ref\":\"<ref_branch>\",\"inputs\":{\"release_version\":\"<release_version>\"}}"}]]}}}}'
}

trigger_release() {
Expand Down
Loading