Skip to content

Commit

Permalink
Move SetTestPipelineVersion.ps1 to eng/common (#17103)
Browse files Browse the repository at this point in the history
Co-authored-by: Chidozie Ononiwu <[email protected]>
  • Loading branch information
azure-sdk and chidozieononiwu authored Mar 5, 2021
1 parent 36e4c0d commit 88d3916
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions eng/common/scripts/SetTestPipelineVersion.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Sets a valid version for a package using the buildID

param (
[Parameter(mandatory = $true)]
$BuildID,
[Parameter(mandatory = $true)]
$PackagName,
[Parameter(mandatory = $true)]
$ServiceDirectory
)

. common.ps1

$latestTags = git tag -l "${PackageName}_*"
$semVars = @()

Foreach ($tags in $latestTags)
{
$semVars += $tags.Replace("${PackageName}_", "")
}

$semVarsSorted = [AzureEngSemanticVersion]::SortVersionStrings($semVars)
LogDebug "Last Published Version $($semVarsSorted[0])"

$newVersion = [AzureEngSemanticVersion]::new($semVarsSorted[0])
$newVersion.PrereleaseLabel = $newVersion.DefaultPrereleaseLabel
$newVersion.PrereleaseNumber = $BuildID

LogDebug "Version to publish [ $($newVersion.ToString()) ]"

SetPackageVersion -PackageName $PackagName `
-Version $newVersion `
-ServiceDirectory $ServiceDirectory `

0 comments on commit 88d3916

Please sign in to comment.