gpt4 book ai didi

git - 发布 repo 时使用 travis 增加 git 版本

转载 作者:行者123 更新时间:2023-12-03 19:11:14 25 4
gpt4 key购买 nike

我要Travis每当我接受依赖的机器人更改时发布 npm。我添加了 npm 电子邮件和身份验证 token 。

我的 travis 配置现在是这样(我不确定是否正确)

language: node_js
node_js:
- "node"
install:
- "npm install"
script:
- "npm run test"
before_deploy:

deploy:
provider: npm
email: "$npm_email"
api_key: "$npm_token"
on:
branch: production

npm test 看起来像这样
  "scripts": {
"test": "jest"
}

如何让 travis 增加 npm 包版本并在 git 上也有该包版本? changelog.md 一样吗?

最佳答案

一个很好的成熟的解决方案是 semantic-release .

使用语义释放时,您的提交消息需要遵守 a specific format .然后,您将配置您的 travis 管道以运行语义发布,它解析您的提交、生成变更日志、新版本号,并将变更作为新提交(用于变更日志)和新标签推送到您的存储库。

设置有点复杂,但您将拥有一个稳定的解决方案,可确保您的版本号有意义。此外,您可以获得“免费”自动生成的变更日志。

还有a recipe for travis这应该有助于设置它。

关于git - 发布 repo 时使用 travis 增加 git 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62034808/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com