I use Azure DevOps Pipelines with GitVersion.
I have one git repository with two projects in folders:
ProjectA/ProjectA.csproj
ProjectA/azure-pipelines.yml
ProjectA/gitversion.yml
ProjectB/ProjectB.csproj
ProjectB/azure-pipelines.yml
ProjectB/gitversion.yml
The beginning of my pipeline.yml looks like this:
trigger:
branches:
include:
- '*'
paths:
include:
- 'ProjectA' <-- ProjectB in the other file
# Setup everything
steps:
- task: NuGetCommand@2
displayName: 'Install GitVersion CLI Tool'
inputs:
command: custom
arguments: install GitVersion.CommandLine -Version 5.0.0 -OutputDirectory $(Build.BinariesDirectory)/tools -ExcludeVersion
- task: UseDotNet@2
displayName: 'Install .NET Core SDK 3.0'
inputs:
packageType: 'sdk'
version: '3.x'
includePreviewVersions: true
# Execute the GitVersion Tool
- script: mono $(Build.BinariesDirectory)/tools/GitVersion.CommandLine/tools/GitVersion.exe /output buildserver /nofetch
displayName: 'Execute GitVersion CLI Tool'
followed by dotnet restore, build and so on.
My issue is let's say ProjectA get's the version "-alpha12" through commits. And then I commit to ProjectB it get's the version "-alpha13". But these two projects are independent from each other and so should the version.
What I mentioned is, there is nowhere a path to the gitversion.yml and I think the build process is just working with defaults. But I don't know how to specify the path to the gitversion.yml and don't know if that would solve my issue.
Can someone help me?