File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -86,24 +86,30 @@ public class BuildVersion
8686 if ( label == branchName )
8787 label = "ci" ;
8888
89+ string suffix = "-" + label ;
90+
8991 switch ( label )
9092 {
9193 case "ci" :
9294 branchName = Regex . Replace ( branchName , "[^0-9A-Za-z-]+" , "-" ) ;
93- string suffix = $ "-ci{ _gitVersion . CommitsSinceVersionSourcePadded } -{ branchName } ";
94- // Nuget limits "special version part" to 20 chars. Add one for the hyphen.
95- if ( suffix . Length > 21 )
96- suffix = suffix . Substring ( 0 , 21 ) ;
97- return _gitVersion . MajorMinorPatch + suffix ;
98-
95+ suffix += _gitVersion . CommitsSinceVersionSourcePadded + "-" + branchName ;
96+ break ;
9997 case "dev" :
10098 case "pre" :
10199 case "pr" :
100+ suffix += "." + _gitVersion . PreReleaseNumber ;
101+ break ;
102102 case "rc" :
103103 case "alpha" :
104104 case "beta" :
105105 default :
106- return _gitVersion . SemVer ;
106+ suffix += "." + _gitVersion . CommitsSinceVersionSource ;
107+ break ;
107108 }
109+
110+ // Nuget limits "special version part" to 20 chars. Add one for the hyphen.
111+ if ( suffix . Length > 21 )
112+ suffix = suffix . Substring ( 0 , 21 ) ;
113+ return _gitVersion . MajorMinorPatch + suffix ;
108114 }
109115}
You can’t perform that action at this time.
0 commit comments