Commit 882c2e1e authored by shaw's avatar shaw
Browse files

fix: use environment variable to pass full tag message to GoReleaser

- Extract complete tag message body in workflow using git format
- Pass tag message via TAG_MESSAGE environment variable
- Update goreleaser config to use .Env.TAG_MESSAGE instead of .TagBody
- Fix release notes being truncated to first paragraph only
parent e63d9512
......@@ -85,6 +85,16 @@ jobs:
go-version: '1.24'
cache-dependency-path: backend/go.sum
- name: Get tag message
id: tag_message
run: |
# 获取完整的 tag message(跳过第一行标题)
TAG_MESSAGE=$(git tag -l --format='%(contents:body)' ${GITHUB_REF#refs/tags/})
# 使用 EOF 分隔符处理多行内容
echo "message<<EOF" >> $GITHUB_OUTPUT
echo "$TAG_MESSAGE" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
......@@ -92,6 +102,7 @@ jobs:
args: release --clean --skip=validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_MESSAGE: ${{ steps.tag_message.outputs.message }}
# ===========================================================================
# Docker Build and Push
......
......@@ -56,14 +56,12 @@ release:
name: sub2api
draft: false
prerelease: auto
name_template: "v{{.Version}}"
# 完全使用 tag 消息作为 release 内容
name_template: "Sub2API {{.Version}}"
# 完全使用 tag 消息作为 release 内容(通过环境变量传入)
header: |
## Sub2API {{.Version}}
> AI API Gateway Platform - 将 AI 订阅配额分发和管理
{{ .TagBody }}
{{ .Env.TAG_MESSAGE }}
footer: |
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment