可以使用感叹号在语义发布中处理主要版本更改(又称重大更改)吗?
git commit -m 'feat!: this is breaking, but is not recognized by semantic-release'
传统的提交指南表明,可以在页脚中使用页眉中的感叹号标记重大更改。
这是我一直在测试的工作流程
设置存储库 ✓</h2>
git init
git remote add origin git@github.com:klueless-io/k_genesis.git
git branch -M main
git add .
git commit -am 'first commit'
# Artificial starting version number
git tag v0.0.18 -a -m 'k_genesis initialize repository'
git push -u origin main --tags
git hist
git init
git remote add origin git@github.com:klueless-io/k_genesis.git
git branch -M main
git add .
git commit -am 'first commit'
# Artificial starting version number
git tag v0.0.18 -a -m 'k_genesis initialize repository'
git push -u origin main --tags
git hist
删除单个文件并将其称为新功能✓</h2>
rm a1
git add .
git commit -m 'feat: remove a1'
git hist
rm a1
git add .
git commit -m 'feat: remove a1'
git hist
npx semantic-release --no-ci
git hist
现在使用页脚消息进行重大更改✓</h2>
这不能按预期工作
rm a2
git add .
git commit -m 'feat: removed a2
BREAKING CHANGE: break dancing
'
git hist
这不能按预期工作
rm a2
git add .
git commit -m 'feat: removed a2
BREAKING CHANGE: break dancing
'
git hist
npx semantic-release --no-ci
到目前为止看起来不错 ✓</h2>
现在尝试使用 ! 感叹号 ✗ :( :( :(
rm a3
git add .
git commit -m 'feat!: removed a3 with exclamation in header'
npx semantic-release --no-ci
# Analysis of 1 commits complete: no release
git hist
touch xmen
git add .
git commit -m 'feat: normal feat'
npx semantic-release --no-ci
git hist
尝试自定义配置
我使用了“@semantic-release/commit-analyzer”(角度)的默认预设,并尝试了自定义预设(conventionalcommits)
{
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer", {
"preset": "conventionalcommits"
}
]
}
查看源代码
当我查看源代码时,它看起来像是应该支持标头中的重大更改。