【发布时间】:2020-09-24 11:27:40
【问题描述】:
我们在 CI 管道中使用 NB.GV,例如:
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . nbgv --ignore-failed-sources
displayName: Install NBGV tool
- script: nbgv cloud -c -a
displayName: Set Version
它正确设置了版本,因此在进一步的任务中,我们可以使用它们(例如 $(GitBuildVersion))
当我们尝试根据this 文章设置 CD 管道时,问题就出现了。在那里我们需要读取$(Build.BuildNumber),它的值与预期的不同。基于official documentation 它应该是例如1.3.1.57621,但我们得到的是 1.3.1+g15e1898f47。
似乎 AssemblyInformationalVersion 和 BuildVersion 交换了。
我们在 version.json 中设置了setVersionVariables: true。
提前感谢您的帮助
【问题讨论】:
-
NGBV 设置 BuildNumber,这就是这个工具的作用。那么您能解释一下您在这里遇到的具体问题吗?
-
在我们的例子中,它在 CD(发行版)中错误地设置了 BuildNumber。我们期待像 1.3.1.57621 这样的东西,但我们得到的是 1.3.1+g15e1898f47。需要提到的是,在整个 CI 管道中是可以的。开始新版本时,BuildNumber 设置为 1.3.1+g15e1898f47 而不是应为的 1.3.1.57621。
标签: azure-devops azure-pipelines versioning