GitVersion.yml 文件理解

Posted

技术标签:

【中文标题】GitVersion.yml 文件理解【英文标题】:GitVersion.yml file understanding 【发布时间】:2021-11-20 20:34:08 【问题描述】:
branches:
  main:
    regex: ^master$|^main$
    mode: ContinuousDelivery
    tag: ''
    increment: Patch
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false
    tracks-release-branches: false
    is-release-branch: false
  release:
    regex: ^releases?[/-]
    mode: ContinuousDelivery
    tag: beta
    increment: Patch
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false
    tracks-release-branches: false
    is-release-branch: true
    pre-release-weight: 1000
  feature:
    regex: ^features?[/-]
    mode: ContinuousDelivery
    tag: useBranchName
    increment: Inherit
    prevent-increment-of-merged-branch-version: false
    track-merge-target: false
    tracks-release-branches: false
    is-release-branch: false
  pull-request:
    regex: ^(pull|pull\-requests|pr)[/-]
    mode: ContinuousDelivery
    tag: PullRequest
    increment: Inherit
    prevent-increment-of-merged-branch-version: false
    tag-number-pattern: '[/-](?<number>\d+)[-/]'
    track-merge-target: false
    tracks-release-branches: false
    is-release-branch: false
  hotfix:
    regex: ^hotfix(es)?[/-]
    mode: ContinuousDelivery
    tag: beta
    increment: Patch
    prevent-increment-of-merged-branch-version: false
    track-merge-target: false
    tracks-release-branches: false
    is-release-branch: false
  support:
    regex: ^support[/-]
    mode: ContinuousDelivery
    tag: ''
    increment: Patch
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false
    tracks-release-branches: false
    is-release-branch: false
  develop:
    regex: ^dev(elop)?(ment)?$
    mode: ContinuousDeployment
    tag: unstable
    increment: Minor
    prevent-increment-of-merged-branch-version: false
    track-merge-target: true
    tracks-release-branches: true
    is-release-branch: false

谁能解释一下 GitVersion.yml 文件。它是如何工作的。另外我不想使用 betaxxxx 创建版本。我只想发布只有 1.1.2/1.1.3 这样的数字的版本。 我必须对此 GitVersion 文件进行哪些更改?

【问题讨论】:

gitversion.net/docs/reference/configuration 【参考方案1】:

根据您的gitversion.yml 文件,唯一可发布的分支是release 分支。

您从这些发布分支的每次提交中获得的 semver 都将添加一个 beta 标签。即使你将发布分支命名为releases/v1.2.3,你也会得到1.2.3-beta.someNumber

要获得 semver 1.2.3,您必须在 release 分支 v1.2.3 中的提交中添加一个 git 标记。 Gitversion 会识别提交有 git 标签,并将 git 标签中的版本用作 semver。

此行为由另一个隐藏的 gitversion 要求实现:tag-prefix: '[vV]'

在带有 git 标记的提交中,gitversion 会绕过gitversion.yml 中指定的许多特定于分支的配置。

在此处阅读更多信息:https://gitversion.net/docs/reference/configuration

【讨论】:

以上是关于GitVersion.yml 文件理解的主要内容,如果未能解决你的问题,请参考以下文章

pymongo.errors.ConfigurationError: Server at 10.2.6.31:27017 reports wire version 5, but this versio

Symfony fos:user:create through error "could not find driver", (Xampp with multiple versio

Docker升级后报错:Error response from daemon: client version 1.40 is too new. Maximum supported API versio

使用hibernate出现log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Versio

RXTX串口协议,端口properties文件设置,获取

从.php文件中删除恶意代码注入