chore: 优化release显示

This commit is contained in:
digua committed 2026-01-08 10:45:25 +08:00
1 parent a21ce00b7a
commit d29cbbf7cc
2 files changed
+13 -9

No files matched your search

+6 -6
View File
@@ -208,13 +208,13 @@ jobs:
echo "---"
echo ""
echo "## 下载说明"
echo "## Download"
echo ""
echo "| 平台 | 文件 |"
echo "|------|------|"
echo "| Mac 苹果芯片 | \`ChatLab-${VERSION_NUMBER}-arm64.dmg\` |"
echo "| Mac Intel 芯片 | \`ChatLab-${VERSION_NUMBER}-x64.dmg\` |"
echo "| Windows | \`ChatLab-${VERSION_NUMBER}-setup.exe\` |"
echo "| Platform | File |"
echo "|-----------------|-------------|"
echo "| Mac (Apple Silicon) | [ChatLab-${VERSION_NUMBER}-arm64.dmg](https://github.com/hellodigua/ChatLab/releases/download/v${VERSION_NUMBER}/ChatLab-${VERSION_NUMBER}-arm64.dmg) |"
echo "| Mac (Intel) | [ChatLab-${VERSION_NUMBER}-x64.dmg](https://github.com/hellodigua/ChatLab/releases/download/v${VERSION_NUMBER}/ChatLab-${VERSION_NUMBER}-x64.dmg) |"
echo "| Windows | [ChatLab-${VERSION_NUMBER}-setup.exe](https://github.com/hellodigua/ChatLab/releases/download/v${VERSION_NUMBER}/ChatLab-${VERSION_NUMBER}-setup.exe) |"
} > release_notes.md
echo "Generated release notes:"
+7 -3
View File
@@ -61,9 +61,13 @@ const checkUpdate = (win) => {
.replace(/\n{2,}/g, '\n')
.trim()
// 如果包含"下载说明",截断该部分及之后的内容
const downloadGuideIndex = releaseNotes.indexOf('下载说明')
if (downloadGuideIndex > 0) {
// 如果包含下载说明章节,截断该部分及之后的内容(匹配二级标题,支持中英文)
const downloadGuideIndex = Math.min(
...[releaseNotes.indexOf('## Download'), releaseNotes.indexOf('## 下载说明')]
.filter((i) => i > 0)
.concat([Infinity])
)
if (downloadGuideIndex < Infinity) {
releaseNotes = releaseNotes.substring(0, downloadGuideIndex).trim()
}
}