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")
21
21
RunGitVersionOnCI ( parameters ) ;
22
22
} ) ;
23
23
24
+ Task ( "Validate-Version" )
25
+ . IsDependentOn ( "Build" )
26
+ . Does < BuildParameters > ( ( parameters ) =>
27
+ {
28
+ ValidateVersion ( parameters ) ;
29
+ } ) ;
30
+
24
31
#endregion
25
32
26
33
#region Pack
27
34
Task ( "Pack-Prepare" )
28
- . IsDependentOn ( "Build " )
35
+ . IsDependentOn ( "Validate-Version " )
29
36
. Does < BuildParameters > ( ( parameters ) =>
30
37
{
31
38
// 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)
121
121
return gitVersion ;
122
122
}
123
123
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
+
124
142
void RunGitVersionOnCI ( BuildParameters parameters )
125
143
{
126
144
// set the CI build version number with GitVersion
You can’t perform that action at this time.
0 commit comments