gitlink-cli/skills/gitlink-release-auto/examples/release-notes-workflow.md

114 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Release Notes 生成完整工作流示例(含数据分析)
**场景**:项目即将发布新版本,需要根据 commit 生成带统计分析和分类的 Release Notes。
## 前置条件
- `gitlink-cli` 已安装并登录
## 工作流步骤
### Step 1获取当前最新 Release
```bash
gitlink-cli release +list --owner z2_cc --repo gitlink-cli --format json
```
**分析:** 找到最新 tag 作为版本对比基线。假设为 v1.2.0。
### Step 2获取提交历史
```bash
git log v1.2.0..HEAD --format="%H|%s|%an|%ad" --date=short
```
**AI 分类统计过程:**
```
原始提交:
a4587f9|feat: add webhook +failed and +task-view|wqer|2026-06-04
37a0f21|docs: add release notes workflow example|wqer|2026-06-17
6c0ad3b|feat: add three new skills|wqer|2026-06-17
d1cc68b|docs: add workflow examples|wqer|2026-06-17
9a51db0|feat: add wiki and snippet skills|wqer|2026-06-17
分类统计:
✨ 新功能3 次 (60%)
📝 文档2 次 (40%)
总提交5 次1 位贡献者
```
### Step 3统计变更文件
```bash
git log v1.2.0..HEAD --stat --oneline
```
**统计结果:**
```
涉及 12 个文件
新增 +245 行,删除 -89 行
主要变更模块shortcuts/webhook/、skills/
```
### Step 4推荐版本号
```
最新版本v1.2.0(仅修订号变更)
提交类型:包含 feat无 BREAKING CHANGE
推荐版本v1.3.0(次版本号 +1
```
### Step 5生成带分类和统计的 Release Notes
```markdown
## v1.3.0 (2026-06-17)
### 📊 版本概览
- 5 次提交 | 12 个文件变更
- +245 / -89 行 | 1 位贡献者
### ✨ 新功能3
- feat: 新增 Webhook 投递监控failed + task-view
- feat: 新增三个 AI Agent Skill
- feat: 新增 Wiki 和代码片段 Skill
### 📝 文档2
- docs: 添加 Release Notes 工作流示例
- docs: 添加其他工作流示例
### 📈 统计汇总
| 类别 | 数量 | 占比 |
|------|------|------|
| ✨ 新功能 | 3 | 60% |
| 📝 文档 | 2 | 40% |
```
### Step 6创建 Release
```bash
gitlink-cli release +create --owner z2_cc --repo gitlink-cli \
--tag v1.3.0 \
--name "v1.3.0" \
--body "## v1.3.0 (2026-06-17)\n\n### 📊 版本概览\n- 5 次提交 | 12 个文件变更\n- +245 / -89 行 | 1 位贡献者\n\n### ✨ 新功能3\n- feat: 新增 Webhook 投递监控\n- feat: 新增三个 AI Agent Skill\n- feat: 新增 Wiki 和代码片段 Skill" \
--target master
```
---
## 完整命令速览
```bash
# 1. 获取基线版本
gitlink-cli release +list
# 2. 获取提交历史
git log <基线>..HEAD --format="%H|%s|%an|%ad" --date=short
# 3. 统计变更
git log <基线>..HEAD --stat --oneline
# 4. 创建 Release
gitlink-cli release +create --tag <版本> --name <名称> --body <Release Notes>
```