我对 Travis CI 还很陌生,但我使用他们的文档找到了解决方法。然而,部署到 GitHub 版本对我来说不起作用。
我的.travis.yml
文件看起来像这样:
language: java
branches:
only:
- master
notifications:
email: false
before_deploy:
- export RELEASE_JAR_FILE=$(ls build/libs/*.jar)
- echo "Deploying $RELEASE_JAR_FILE to GitHub"
deploy:
provider: releases
api_key:
secure: [key]
file_glob: true
file: "${RELEASE_JAR_FILE}"
skip_cleanup: true
on:
repo: [my-repo]
tags: true
all_branches: true
以下是我的承诺:
$ git add . && git commit -m "my message"
$ git tag 0.1234
$ git push origin --tags
$ git push origin master
之后,Travis 创建构建并跳过部署
Skipping a deployment with the releases provider because this is not a tagged commit
当我在浏览器中打开 GitHub 存储库时,版本已正确标记,但 Travis 未检测到它们已标记。
有人有解决方案吗?我怀疑branches: only: master
尽管特拉维斯对这种行为负有部分责任once将版本推送到 GitHub,但没有on: tags: true
旗帜。之后,如果我遗漏了表示我只能将标记的提交作为发布推送的标志,我就会收到错误。
你需要删除
branches:
only:
- master
See https://github.com/travis-ci/travis-ci/issues/2498#issuecomment-48337712 https://github.com/travis-ci/travis-ci/issues/2498#issuecomment-48337712
我意识到这很糟糕,但我不确定 Travis 是否可以按照您想要的方式进行配置。您可能想要开票 -https://github.com/travis-ci/travis-ci/issues/new https://github.com/travis-ci/travis-ci/issues/new
UPDATE:
对中的标签使用正则表达式branches.only
:
branches:
only:
- master
- /v\d+\.\d+[a-z]/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)