mic*_*eln 13 git github travis-ci
我对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
Run Code Online (Sandbox Code Playgroud)
这是我的承诺:
$ git add . && git commit -m "my message"
$ git tag 0.1234
$ git push origin --tags
$ git push origin master
Run Code Online (Sandbox Code Playgroud)
之后,Travis创建构建并跳过部署
Skipping a deployment with the releases provider because this is not a tagged commit
Run Code Online (Sandbox Code Playgroud)
当我在浏览器中打开我的GitHub存储库时,版本被正确标记,但Travis没有将它们标记为已标记.
有人有解决方案吗?我怀疑这branches: only: master部分是对这种行为负责的,尽管特拉维斯曾在没有on: tags: true旗帜的情况下向GitHub推出了一个版本.之后,如果我遗漏了标记,说我只能将标记的提交作为释放,那么我就会出错.
Spa*_*ain 13
你需要删除
branches:
only:
- master
Run Code Online (Sandbox Code Playgroud)
请参阅https://github.com/travis-ci/travis-ci/issues/2498#issuecomment-48337712
我意识到这是一个无赖,但我不确定Travis是否可以按照你想要的方式进行配置.您可能想要打开一张票 - https://github.com/travis-ci/travis-ci/issues/new
更新:
在以下标签中使用正则表达式branches.only:
branches:
only:
- master
- /v\d+\.\d+[a-z]/
Run Code Online (Sandbox Code Playgroud)