git 版本自动工具 standard-version

standard-version可以进行版本自动化,以及生成CHANGELOG.md,使用git tag 也会自动更新package.json的version版本。

安装

npm i standard-version -D

在 package.json 中编写响应的脚本:

"scripts": {
    "release": "standard-version"
  },

CHANGELOG.md配置

新建.versionrc

{
  "types": [
    {"type": "chore", "section":"'🎫 Chores | 其他更新", "hidden": false},
    {"type": "revert", "section":"⏪ Reverts | 回退", "hidden": false},
    {"type": "feat", "section": "✨ Features | 新功能", "hidden": false},
    {"type": "fix", "section": "🐛 Bug Fixes | Bug 修复", "hidden": false},
    {"type": "improvement", "section": "Feature Improvements", "hidden": false},
    {"type": "docs", "section":"📝 Documentation | 文档", "hidden": false},
    {"type": "style", "section":"💄 Styles | 风格", "hidden": false},
    {"type": "refactor", "section":"💄 Styles | 风格", "hidden": false},
    {"type": "perf", "section":"⚡ Performance Improvements | 性能优化", "hidden": false},
    {"type": "test", "section":"✅ Tests | 测试", "hidden": false},
    {"type": "build", "section":"👷‍ Build System | 构建", "hidden": false},
    {"type": "ci", "section":"🔧 Continuous Integration | CI 配置", "hidden":false}
  ]
}

执行:

1、git add

2、git commit

3、npm run release

4、git push

PS:也可以配合GITHUBS ACTIONS 去使用

gitlab.yml如下

PR到master时会执行

也可以执行npm run pubilsh发布到npm 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值