File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,18 @@ Task("Build")
2121 RunGitVersionOnCI ( parameters ) ;
2222} ) ;
2323
24+ Task ( "Validate-Version" )
25+ . IsDependentOn ( "Build" )
26+ . Does < BuildParameters > ( ( parameters ) =>
27+ {
28+ ValidateVersion ( parameters ) ;
29+ } ) ;
30+
2431#endregion
2532
2633#region Pack
2734Task ( "Pack-Prepare" )
28- . IsDependentOn ( "Build " )
35+ . IsDependentOn ( "Validate-Version " )
2936 . Does < BuildParameters > ( ( parameters ) =>
3037{
3138 // publish single file for all native runtimes (self contained)
Original file line number Diff line number Diff line change @@ -121,6 +121,24 @@ GitVersion GetVersion(BuildParameters parameters)
121121 return gitVersion ;
122122}
123123
124+ void ValidateVersion ( BuildParameters parameters )
125+ {
126+ var gitVersionTool = GetFiles ( $ "artifacts/**/bin/{ parameters . CoreFxVersion31 } /GitVersion.dll") . FirstOrDefault ( ) ;
127+ IEnumerable < string > output ;
128+ var fullFxResult = StartProcess (
129+ "dotnet" ,
130+ new ProcessSettings {
131+ Arguments = $ "\" { gitVersionTool } \" -version",
132+ RedirectStandardOutput = true ,
133+ } ,
134+ out output
135+ ) ;
136+
137+ var outputStr = string . Concat ( output ) ;
138+
139+ Assert . Equal ( parameters . Version . SemVersion , outputStr ) ;
140+ }
141+
124142void RunGitVersionOnCI ( BuildParameters parameters )
125143{
126144 // set the CI build version number with GitVersion
You can’t perform that action at this time.
0 commit comments