Skip to content

Commit 414cb78

Browse files
committed
chore: 优化了release workflow
解决了gitee在上传时的报错 调整了release note 的显示内容
1 parent 92ac521 commit 414cb78

File tree

1 file changed

+37
-50
lines changed

1 file changed

+37
-50
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -117,76 +117,59 @@ jobs:
117117
$previousTag = git rev-list --max-parents=0 HEAD
118118
}
119119
120-
# 生成变更日志
121-
$commits = git log "$previousTag..$tag" --pretty=format:"* %s (%h)" --no-merges 2>$null
120+
# 生成格式化的变更日志
121+
$commits = (git log "$previousTag..$tag" --pretty=format:"* %s (`%h`)" --no-merges 2>$null) -join "`n"
122122
if ([string]::IsNullOrEmpty($commits)) {
123-
$commits = git log -10 --pretty=format:"* %s (%h)" --no-merges
123+
$commits = (git log -10 --pretty=format:"* %s (`%h`)" --no-merges) -join "`n"
124124
}
125125
126126
# 获取贡献者列表
127-
$contributors = git log "$previousTag..$tag" --pretty=format:"%an" --no-merges 2>$null | Sort-Object -Unique
128-
if ([string]::IsNullOrEmpty($contributors)) {
129-
$contributors = git log -10 --pretty=format:"* %s (%h)" --no-merges | Sort-Object -Unique
127+
$contributors = (git log "$previousTag..$tag" --pretty=format:"%an" --no-merges 2>$null | Sort-Object -Unique)
128+
if ($contributors.Count -eq 0) {
129+
$contributors = (git log -10 --pretty=format:"%an" --no-merges | Sort-Object -Unique)
130130
}
131+
$contributorsList = ($contributors | ForEach-Object { "* @$_" }) -join "`n"
131132
132-
# 版本说明
133+
# 构建精简后的版本说明
133134
$versionGuide = @"
134135
## 📦 版本说明
135-
136-
本次发布提供了多个版本以满足不同用户的需求:
137-
138-
### 🎯 版本类型
139-
140-
#### 安装包版本 (Installer)
141-
- **完整版** (`zerolaunch-rs_{版本}_{架构}-setup.exe` / `.msi`)
142-
- 包含所有功能,支持 AI 智能搜索
143-
- 提供完整的用户体验
144-
145-
- **精简版** (`zerolaunch-rs_lite_{版本}_{架构}-setup.exe` / `.msi`)
146-
- 不包含 AI 功能,体积更小
147-
- 适合不需要 AI 功能的用户
148-
149-
#### 便携版本 (Portable)
150-
- **完整版** (`ZeroLaunch-portable-{版本}-{架构}.zip`)
151-
- 解压即用,包含 AI 功能
152-
- 无需安装,适合移动使用
153-
154-
- **精简版** (`ZeroLaunch-portable-lite-{版本}-{架构}.zip`)
155-
- 解压即用,不含 AI 功能
156-
- 体积更小,启动更快
157-
158-
### 🏗️ 架构支持
159-
- **x64**: 适用于 Intel/AMD 64位处理器
160-
- **arm64**: 适用于 ARM64 架构(如高通骁龙)
136+
137+
- **安装版 (`.exe`/`.msi`)**: 提供传统的安装体验。
138+
- **便携版 (`.zip`)**: 无需安装,解压即用,适合移动或绿色版爱好者。
139+
140+
> **完整版**包含 AI 智能搜索功能,而 **精简版 (lite)** 不含 AI 功能,体积更小。
141+
142+
---
161143
162144
### 🤖 关于 AI 功能
163145
164-
> **重要提示**:如需使用 AI 智能搜索功能,需要单独下载模型权重文件
146+
> **重要提示**:AI 智能搜索功能需要单独下载模型权重文件才能使用
165147
166148
**模型下载地址**:
167149
- GitHub: https://github.com/ghost-him/ZeroLaunch-rs/releases/tag/model
168150
- Gitee: https://gitee.com/ghost-him/ZeroLaunch-rs/releases/tag/model
169151
- GitCode: https://gitcode.com/ghost-him/ZeroLaunch-rs/releases/model
170152
171-
模型发布页中包含详细的安装说明,请按照说明进行配置。
172-
173-
### 💡 如何选择版本
174-
175-
- **首次使用**:推荐下载安装包版本(完整版或精简版)
176-
- **需要 AI 功能**:选择完整版 + 下载模型权重
177-
- **追求轻量**:选择精简版
178-
- **便携使用**:选择便携版,可放在 U 盘中随身携带
179-
180-
---
153+
请根据模型发布页中的说明进行配置。
181154
"@
182-
183-
# 构建 Release Notes
184-
$contributorsList = ($contributors | ForEach-Object { "* $_" }) -join "`n"
155+
156+
# 构建最终的 Release Notes
185157
$changelogUrl = "https://github.com/ghost-him/ZeroLaunch-rs/compare/$previousTag...$tag"
158+
$releaseNotes = @"
159+
$versionGuide
160+
161+
## What's Changed
162+
163+
$commits
164+
165+
## Contributors
166+
167+
$contributorsList
168+
169+
**Full Changelog**: $changelogUrl
170+
"@
186171
187-
$releaseNotes = "$versionGuide`n## What's Changed`n`n$commits`n`n## Contributors`n`n$contributorsList`n`n**Full Changelog**: $changelogUrl"
188-
189-
# 输出到文件,避免多行字符串在 GitHub Actions 中的问题
172+
# 输出到文件
190173
$releaseNotes | Out-File -FilePath "release_notes.txt" -Encoding UTF8
191174
echo "RELEASE_NOTES_FILE=release_notes.txt" >> $env:GITHUB_OUTPUT
192175
echo "Generated release notes"
@@ -273,6 +256,8 @@ jobs:
273256
# 添加 Gitee 远程仓库
274257
git remote add gitee "https://oauth2:$($env:GITEE_TOKEN)@gitee.com/ghost-him/ZeroLaunch-rs.git" || true
275258
259+
git checkout main
260+
276261
# 推送代码和标签到 Gitee
277262
git push gitee main --tags -f || echo "Failed to push to Gitee"
278263
env:
@@ -358,6 +343,8 @@ jobs:
358343
# 添加 GitCode 远程仓库
359344
git remote add gitcode "https://oauth2:$($env:GITCODE_TOKEN)@gitcode.com/ghost-him/ZeroLaunch-rs.git" || true
360345
346+
git checkout main
347+
361348
# 推送代码和标签到 GitCode
362349
git push gitcode main --tags -f || echo "Failed to push to GitCode"
363350
env:

0 commit comments

Comments
 (0)