fix(ci): add GitVersion tool
All checks were successful
agola/client-dotnet/Lint The run finished successfully

This commit is contained in:
Peter Kurfer 2022-09-26 16:41:39 +02:00
parent d8143ffd3a
commit d26b7ff041
No known key found for this signature in database
2 changed files with 8 additions and 2 deletions

View file

@ -13,6 +13,12 @@
"commands": [ "commands": [
"nuke" "nuke"
] ]
},
"gitversion.tool": {
"version": "5.10.3",
"commands": [
"dotnet-gitversion"
]
} }
} }
} }

View file

@ -25,7 +25,7 @@ class Build : NukeBuild
[Solution] readonly Solution? Solution; [Solution] readonly Solution? Solution;
[GitRepository] readonly GitRepository? GitRepository; [GitRepository] readonly GitRepository? GitRepository;
[GitVersion(NoFetch = true, Framework = "net6.0")] readonly GitVersion? GitVersion; [GitVersion(Framework = "net6.0", NoFetch = true)] readonly GitVersion? GitVersion;
GitLab? CI => GitLab.Instance; GitLab? CI => GitLab.Instance;
@ -90,7 +90,7 @@ class Build : NukeBuild
.SetProject(csproj) .SetProject(csproj)
.SetConfiguration(Configuration) .SetConfiguration(Configuration)
.SetOutputDirectory(ArtifactsDirectory) .SetOutputDirectory(ArtifactsDirectory)
.SetVersion(GitVersion?.FullSemVer ?? SemanticVersion.Parse(CI?.CommitTag?.TrimStart('v') ?? "0.0.1").ToNormalizedString()) .SetVersion(GitVersion?.NuGetVersionV2 ?? SemanticVersion.Parse(CI?.CommitTag?.TrimStart('v') ?? "0.0.1").ToNormalizedString())
.EnableIncludeSource() .EnableIncludeSource()
.EnableIncludeSymbols() .EnableIncludeSymbols()
.EnableNoRestore() .EnableNoRestore()