我注意到构建https://travis-ci.org/neverendingqs/openssl-self-signed-certificate/builds/187723295,我忘了增加标签回购时的补丁版本。但是,即使npm发布由于版本已经存在而失败,构建报告为passing
。即使npm发布失败,为什么Travis CI会报告构建成功?
这里是日志的末尾:
Deploying application
NPM API key format changed recently. If your deployment fails, check your API key in ~/.npmrc.
http://docs.travis-ci.com/user/deployment/npm/
~/.npmrc size: 48
npm ERR! publish Failed PUT 403
npm ERR! Linux 4.8.12-040812-generic
npm ERR! argv "/home/travis/.nvm/v0.10.48/bin/node" "/home/travis/.nvm/v0.10.48/bin/npm" "publish"
npm ERR! node v0.10.48
npm ERR! npm v2.15.1
npm ERR! code E403
npm ERR! "You cannot publish over the previously published version 1.1.5." : openssl-self-signed-certificate
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/travis/build/neverendingqs/openssl-self-signed-certificate/npm-debug.log
No stash found.
Done. Your build exited with 0.
在情况下,它是很重要的,我有test
脚本packages.json
设置为exit 0
,但在发布阶段之前发生的,所以这不应该是问题(?)。
为什么Travis CI在发布失败时报告构建失败?
编辑:
我用特拉维斯CI CLI通过运行travis setup npm
,基于https://docs.travis-ci.com/user/deployment/npm/建立NPM发布。
我.travis.yml
看起来是这样的:
language: node_js
deploy:
provider: npm
email: myemail
api_key:
secure: blahblahblah
on:
tags: true
repo: neverendingqs/openssl-self-signed-certificate
我已经更新我如何生成'.travis.yml'内容的问题。 – neverendingqs