[英]Update version in package.json with github release
I need to update the version number in my package.json file when I release it from github.当我从 github 发布它时,我需要更新我的 package.json 文件中的版本号。 Is there any method for that also can I set the newly created tag version as version number in package.json是否有任何方法可以将新创建的标签版本设置为 package.json 中的版本号
There are some libraries that automate this process.有一些库可以自动执行此过程。 One of them is release-it.其中之一是释放它。
https://github.com/release-it/release-it https://github.com/release-it/release-it
This package automatically bumps up the version number in the package.json and create a new brnach/tag.这个包会自动增加 package.json 中的版本号并创建一个新的 brnach/tag。 It also automates pushing to NPM, creating change log, cd/ci etc.它还可以自动推送到 NPM、创建更改日志、cd/ci 等。
"name": "my-package",
"version": "1.0.0",
"scripts": {
"release": "release-it"
},
"devDependencies": {
"release-it": "*"
}
}
then然后
npm run release
or要么
npm run release -- minor --ci
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.