other: 新增canary版本打包逻辑

This commit is contained in:
Liuyf 2024-10-22 09:57:17 +08:00
parent cade03ea5a
commit 2fde801e2c

View File

@ -26,7 +26,7 @@ else
compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=master&to=$CI_COMMIT_BRANCH")
fi
echo "compare_json:$compare_json\n"
new_patch=patch
new_patch=$patch
while IFS= read -r commit_json; do
# 使用 jq 解析每一行的 JSON 对象
commit_id=$(echo "$commit_json" | jq -r '.id')
@ -36,9 +36,9 @@ else
((minor++))
new_patch=0
break
elif [[ "$commit_message" =~ ("fix:"*) ]] && [[ new_patch == path ]]; then
elif [[ "$commit_message" =~ ("fix:"*) ]] && [[ new_patch == patch ]]; then
((new_patch++))
elif [[ ! "$commit_message" =~ ("Merge"* | "Revert"*) ]] && [[ new_patch == path ]]; then
elif [[ ! "$commit_message" =~ ("Merge"* | "Revert"*) ]] && [[ new_patch == patch ]]; then
((new_patch++))
fi
done < <(echo "$compare_json" | jq -c '.commits[] | {id: .id, message: .message}')