-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathrelease.config.js
More file actions
97 lines (91 loc) · 2.23 KB
/
release.config.js
File metadata and controls
97 lines (91 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
export default {
// 发布前检查
preChecks: {
// 是否检查工作目录
checkWorkingDirectory: true,
// 是否运行测试
runTests: false,
// 是否检查代码质量
checkCodeQuality: false,
// 是否检查远程版本冲突
checkVersionConflicts: true,
// 是否检查安全漏洞
checkSecurity: false,
},
// 版本管理
version: {
// 默认发布类型: patch, minor, major
defaultType: 'patch',
// 是否自动递增版本号
autoIncrement: true,
// 版本前缀
tagPrefix: 'v',
},
// Changelog 配置
changelog: {
// 是否生成 changelog
generate: true,
// 文件路径(相对于 monorepo 根目录)
file: '../../docs/changelog.md',
// 提交分类规则
categories: {
feat: '✨ 新功能',
fix: '🐛 问题修复',
docs: '📝 文档更新',
style: '💄 代码格式',
refactor: '♻️ 代码重构',
perf: '⚡ 性能优化',
test: '✅ 测试相关',
chore: '🔧 其他更改',
},
},
// 构建配置
build: {
// 发布前是否构建
beforePublish: true,
// 构建命令
command: 'bun run build',
},
// 发布配置
publish: {
// 是否发布到 npm
npm: true,
// npm 发布配置
npmConfig: {
access: 'public',
registry: 'https://registry.npmjs.org/',
},
// 是否推送到 git
git: true,
// git 推送配置
gitConfig: {
pushTags: true,
pushBranch: true,
},
},
// 钩子函数
hooks: {
// 发布前钩子
beforeRelease: [],
// 发布后钩子
afterRelease: [],
// 失败时钩子
onFailure: [],
},
// 通知配置
notifications: {
// 是否启用通知
enabled: true,
// 通知方式: console, discord
methods: ['console', 'discord'],
// Discord 配置
discord: {
webhookUrl: process.env.DISCORD_WEBHOOK_URL || 'https://discord.com/api/webhooks/1460226980938125387/5fWgMuGmkGtb6j3eoDaz4JtSFfH8LtFtHK9F2srIHGoXp71zm4sHFPCc729PujDbHJ2F',
},
// 通知模板
templates: {
success: '🎉 版本 {{version}} 发布成功!',
failure: '❌ 版本 {{version}} 发布失败:{{error}}',
},
},
};