From e6ff8a887ce0502d2923fde2c21c9bb9d7460a63 Mon Sep 17 00:00:00 2001 From: titor Date: Wed, 8 Apr 2026 02:30:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20release=20=E8=87=AA=E5=8A=A8=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20tag=20=E6=B3=A8=E9=87=8A=E4=BD=9C=E4=B8=BA=20Releas?= =?UTF-8?q?e=20=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/release.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index ad25f09..d818b95 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -42,15 +42,18 @@ jobs: env: GITEA_TOKEN: ${{ secrets.release_token }} run: | - apk add curl + apk add curl jq TAG_NAME="${GITHUB_REF#refs/tags/}" + # 获取 tag 注释或 commit message 作为 release 说明 + RELEASE_BODY=$(git tag -l --format='%(contents)' "$TAG_NAME" 2>/dev/null || git log -1 --format="%s%n%n%b" "$TAG_NAME" 2>/dev/null || echo "Release $TAG_NAME") + # 创建 Release 并获取 release_id RELEASE_RESPONSE=$(curl -s -X POST "https://hub.gaomia.site/api/v1/repos/titor/yoyo/releases" \ -H "Authorization: token ${GITEA_TOKEN}" \ -H "Content-Type: application/json" \ - -d "{\"tag_name\":\"${TAG_NAME}\",\"name\":\"${TAG_NAME}\",\"body\":\"Automated release\"}") + -d "{\"tag_name\":\"${TAG_NAME}\",\"name\":\"${TAG_NAME}\",\"body\":\"${RELEASE_BODY}\"}") RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)