gpt4 book ai didi

git - Travis-CI 跳过部署,尽管 Commit 被标记

转载 作者:IT王子 更新时间:2023-10-29 00:52:33 25 4
gpt4 key购买 nike

我是 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

以下是我的 promise :

$ 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 部分对此行为负责,尽管 Travis once 在没有 on: tags: true 标志。之后,如果我遗漏了说我只能将标记的提交作为发布推送的标志,我就会出错。

最佳答案

你需要删除

branches:
only:
- master

参见 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]/

关于git - Travis-CI 跳过部署,尽管 Commit 被标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30156581/

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