update at 2025-10-15 17:28:11
This commit is contained in:
6
rel.sh
6
rel.sh
@@ -49,6 +49,10 @@ fi
|
||||
VERSION=$(grep "^## v" release.md | tail -n 1 | sed 's/^## //')
|
||||
TAG_MESSAGE=$(awk "/^## $VERSION/{flag=1;next}/^## v/{flag=0}flag" release.md)
|
||||
|
||||
# 过滤掉 emoji(4 字节 unicode,范围 U+10000 - U+10FFFF),避免 utf8mb4 字符导致服务器侧 collation 问题
|
||||
# 仅在发送到 Gitea 时使用过滤后的内容,保留原始 TAG_MESSAGE 用于本地 tag 注释
|
||||
RELEASE_BODY=$(printf '%s' "$TAG_MESSAGE" | perl -CSD -0777 -pe 's/[\x{10000}-\x{10FFFF}]//g')
|
||||
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "❌ release.md 中未找到版本号"
|
||||
exit 1
|
||||
@@ -126,7 +130,7 @@ if [ "$check_http_code" -eq 200 ]; then
|
||||
fi
|
||||
|
||||
# 使用 jq 生成正确的 JSON
|
||||
JSON_PAYLOAD=$(echo "$TAG_MESSAGE" | jq -R -s -c --arg version "$VERSION" '{
|
||||
JSON_PAYLOAD=$(echo "$RELEASE_BODY" | jq -R -s -c --arg version "$VERSION" '{
|
||||
tag_name: $version,
|
||||
name: $version,
|
||||
body: .,
|
||||
|
||||
Reference in New Issue
Block a user