【发布时间】:2019-10-08 15:45:24
【问题描述】:
我们正在 github 上配置一个公共项目。 我们希望我们的 travis 作业在每个 PR 上运行测试和构建,并且仅在 master 上接受的 MR 上部署(npm publish)。
我们已经尝试过这个配置,但它不起作用:
language: node_js
node_js:
- 10.16.0
before_script:
- npm run build
deploy:
provider: npm
email: "myemail@example.com"
api_key:
secure: "our secure key that is irrelevant for this question"
after_deploy:
- ./script/updateNpmVersion.sh
on:
branch: master
还有./script/updateNpmVersion.sh
#!/bin/bash
git pull develop
npm version minor
git add package.json
git commit -m "bump npm version"
git push origin develop
但它不起作用。基本上从不调用 Deploy。
【问题讨论】: