Dav*_*wys 12 semantic-release conventional-commits conventional-changelog
可以使用感叹号在语义发布中处理主要版本更改(也称为重大更改)吗?
\ngit commit -m \'feat!: this is breaking, but is not recognized by semantic-release\'\nRun Code Online (Sandbox Code Playgroud)\n传统的提交指南表明,可以在页脚中使用页眉中的感叹号来标记重大更改。
\n\n这是我一直在测试的工作流程
\ngit init\ngit remote add origin git@github.com:klueless-io/k_genesis.git\ngit branch -M main\ngit add .\ngit commit -am \'first commit\'\n# Artificial starting version number\ngit tag v0.0.18 -a -m \'k_genesis initialize repository\'\ngit push -u origin main --tags\ngit hist\nRun Code Online (Sandbox Code Playgroud)\n\nrm a1\ngit add .\ngit commit -m \'feat: remove a1\'\ngit hist\nRun Code Online (Sandbox Code Playgroud)\n\nnpx semantic-release --no-ci\nRun Code Online (Sandbox Code Playgroud)\n\ngit hist\nRun Code Online (Sandbox Code Playgroud)\n\n\n\n这没有按预期工作
\n
rm a2\ngit add .\ngit commit -m \'feat: removed a2 \n\nBREAKING CHANGE: break dancing\n\'\ngit hist\nRun Code Online (Sandbox Code Playgroud)\n\ngit hist\nRun Code Online (Sandbox Code Playgroud)\n\nrm a2\ngit add .\ngit commit -m \'feat: removed a2 \n\nBREAKING CHANGE: break dancing\n\'\ngit hist\nRun Code Online (Sandbox Code Playgroud)\n\nnpx semantic-release --no-ci\nRun Code Online (Sandbox Code Playgroud)\n\ngit hist\nRun Code Online (Sandbox Code Playgroud)\n\nrm a3\ngit add .\ngit commit -m \'feat!: removed a3 with exclamation in header\' \nRun Code Online (Sandbox Code Playgroud)\n\n我已经使用了“@semantic-release/commit-analyzer”( Angular )的默认预设,并且尝试了自定义预设(conventioncommits)
\n\nnpx semantic-release --no-ci\n# Analysis of 1 commits complete: no release\nRun Code Online (Sandbox Code Playgroud)\n当我查看源代码convention-changelog-conventionalcommits时,它似乎应该支持标头中的重大更改。
\n\n您需要手动配置它.releaserc:
YAML
branches:
- main
plugins:
- - "@semantic-release/commit-analyzer"
- preset: conventionalcommits
releaseRules:
- type: '*!'
release: major
Run Code Online (Sandbox Code Playgroud)
JSON
{
"branches": [
"main"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{
"type": "*!",
"release": "major"
}
]
}
]
]
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3413 次 |
| 最近记录: |