File tree 1 file changed +33
-0
lines changed
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Sets a valid version for a package using the buildID
2
+
3
+ param (
4
+ [Parameter (mandatory = $true )]
5
+ $BuildID ,
6
+ [Parameter (mandatory = $true )]
7
+ $PackagName ,
8
+ [Parameter (mandatory = $true )]
9
+ $ServiceDirectory
10
+ )
11
+
12
+ . common.ps1
13
+
14
+ $latestTags = git tag - l " ${PackageName} _*"
15
+ $semVars = @ ()
16
+
17
+ Foreach ($tags in $latestTags )
18
+ {
19
+ $semVars += $tags.Replace (" ${PackageName} _" , " " )
20
+ }
21
+
22
+ $semVarsSorted = [AzureEngSemanticVersion ]::SortVersionStrings($semVars )
23
+ LogDebug " Last Published Version $ ( $semVarsSorted [0 ]) "
24
+
25
+ $newVersion = [AzureEngSemanticVersion ]::new($semVarsSorted [0 ])
26
+ $newVersion.PrereleaseLabel = $newVersion.DefaultPrereleaseLabel
27
+ $newVersion.PrereleaseNumber = $BuildID
28
+
29
+ LogDebug " Version to publish [ $ ( $newVersion.ToString ()) ]"
30
+
31
+ SetPackageVersion - PackageName $PackagName `
32
+ - Version $newVersion `
33
+ - ServiceDirectory $ServiceDirectory `
You can’t perform that action at this time.
0 commit comments