Git 版本总是将 prerelase 标签设置为 "unstable" - 如何让它尊重配置文件?

Git version always sets prerelase label to "unstable" - how to make it respect config file?

我一辈子都想不出如何将 PreReleaseLabel 更改为 Alpha 或 GitVersionConfig.yaml 中的任何内容。有没有办法让 gitversion 追踪它的想法?

这是我的 gitversion 输出:

GitVersion.exe

{
  "Major":3,
  "Minor":10,
  "Patch":1,
  "PreReleaseTag":"unstable.1",
  "PreReleaseTagWithDash":"-unstable.1",
  "PreReleaseLabel":"unstable",
  "PreReleaseNumber":1,
  "BuildMetaData":"",
  "BuildMetaDataPadded":"",
  "FullBuildMetaData":"Branch.develop.Sha.93033f2b5a166cb44da9dff6d72697de68096499",
  "MajorMinorPatch":"3.10.1",
  "SemVer":"3.10.1-unstable.1",
  "LegacySemVer":"3.10.1-unstable1",
  "LegacySemVerPadded":"3.10.1-unstable0001",
  "AssemblySemVer":"3.10.1.0",
  "FullSemVer":"3.10.1-unstable.1",
  "InformationalVersion":"3.10.1-unstable.1+Branch.develop.Sha.93033f2b5a166cb44da9dff6d72697de68096499",
  "BranchName":"develop",
  "Sha":"93033f2b5a166cb44da9dff6d72697de68096499",
  "NuGetVersionV2":"3.10.1-unstable0001",
  "NuGetVersion":"3.10.1-unstable0001",
  "CommitsSinceVersionSource":1,
  "CommitsSinceVersionSourcePadded":"0001",
  "CommitDate":"2016-02-10"
}

GitVersion.exe /输出构建服务器

INFO [02/10/16 17:00:35:73] Working directory: C:\BuildAgents\Agent-XXX\_work\s
INFO [02/10/16 17:00:35:78] Project root is: C:\BuildAgents\Agent-XXX\_work\s
INFO [02/10/16 17:00:35:93] Using latest commit on specified branch
INFO [02/10/16 17:00:35:96] Running against branch: develop (93033f2b5a166cb44da9dff6d72697de68096499)
INFO [02/10/16 17:00:35:98] Begin: Calculating base versions
  INFO [02/10/16 17:00:36:14] Fallback base version: 0.1.0 with commit count source 5c313e354c091a41573564037215c3cfc5e43b80
  INFO [02/10/16 17:00:36:29] NextVersion in GitVersionConfig.yaml: 3.10.0 with commit count source External Source
  INFO [02/10/16 17:00:36:53] Git tag 'v3.10.0': 3.10.0 with commit count source cedfccd47c77bca9ea4ccd43aa7492afc169a493
  INFO [02/10/16 17:00:36:59] Git tag 'v3.10.0': 3.10.0 with commit count source cedfccd47c77bca9ea4ccd43aa7492afc169a493
  INFO [02/10/16 17:00:36:84] Found multiple base versions which will produce the same SemVer (3.10.1), taking oldest source for commit counting (Git tag 'v3.10.0')
  INFO [02/10/16 17:00:36:84] Base version used: Git tag 'v3.10.0': 3.10.0 with commit count source cedfccd47c77bca9ea4ccd43aa7492afc169a493
INFO [02/10/16 17:00:36:84] End: Calculating base versions (Took: 859.31ms)
INFO [02/10/16 17:00:36:96] 1 commits found between cedfccd47c77bca9ea4ccd43aa7492afc169a493 and 93033f2b5a166cb44da9dff6d72697de68096499

这是我的GitVersionConfig.yaml文件

next-version: 3.10.0
mode: ContinuousDeployment

continuous-delivery-fallback-tag: Alpha
branches: 
  develop:
    mode: ContinuousDeployment
    tag: 
    increment: Patch
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false

  features?[/-]:
    mode: ContinuousDeployment
    tag: useBranchName
    increment: Minor
    prevent-increment-of-merged-branch-version: false
    track-merge-target: false
next-version: 3.10.0
mode: ContinuousDeployment

branches: 
  develop:
    mode: ContinuousDeployment
    tag: Alpha
    increment: Patch
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false

  features?[/-]:
    mode: ContinuousDeployment
    tag: useBranchName
    increment: Minor
    prevent-increment-of-merged-branch-version: false
    track-merge-target: false

那应该没问题。 develop 中的空标签将默认返回 unstable。如果要清除标签,则需要使用空引号。我认为增强日志记录配置是个好主意。