- 修复 env 变量语法 - 简化 release body 构造 - 修复 JSON 格式
This commit is contained in:
7
.github/workflows/release.yml
vendored
7
.github/workflows/release.yml
vendored
@@ -42,14 +42,11 @@ jobs:
|
||||
run: |
|
||||
GITEA_URL="https://hub.gaomia.site"
|
||||
REPO="titor/haibao-tts-cli"
|
||||
WORKDIR="/workspace/mimo-tts"
|
||||
|
||||
cd "$WORKDIR"
|
||||
cd /workspace/mimo-tts
|
||||
COMMIT_MSG=$(git log -1 --format="%s" HEAD)
|
||||
COMMIT_BODY=$(git log -1 --format="%b" HEAD)
|
||||
|
||||
TAG_NAME="latest"
|
||||
RELEASE_BODY="${COMMIT_MSG}\n\n${COMMIT_BODY}"
|
||||
|
||||
# 删除已存在的 release(如果存在)
|
||||
curl -s -X DELETE "${GITEA_URL}/api/v1/repos/${REPO}/releases/tags/${TAG_NAME}" \
|
||||
@@ -59,7 +56,7 @@ jobs:
|
||||
RELEASE_RESPONSE=$(curl -s -X POST "${GITEA_URL}/api/v1/repos/${REPO}/releases" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"${TAG_NAME}\",\"name\":\"${TAG_NAME}\",\"body\":\"${RELEASE_BODY}\",\"draft\":false}")
|
||||
-d "{\"tag_name\":\"${TAG_NAME}\",\"name\":\"Release ${TAG_NAME}\",\"body\":\"${COMMIT_MSG}\",\"draft\":false}")
|
||||
|
||||
RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user