Skip to content

Commit

Permalink
Fix null errors in SetTestPipelineVersion, Update Package Upload step…
Browse files Browse the repository at this point in the history
… name.
  • Loading branch information
chidozieononiwu committed Jul 5, 2022
1 parent 160c203 commit 9292e45
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
24 changes: 17 additions & 7 deletions eng/common/scripts/SetTestPipelineVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,32 @@ param (

. (Join-Path $PSScriptRoot common.ps1)

Write-Host "PackageName: $PackageName"
Write-Host "ServiceDirectory: $ServiceDirectory"
Write-Host "BuildID: $BuildID"

$newVersion = [AzureEngSemanticVersion]::new("1.0.0")
$latestTags = git tag -l "${PackageName}_*"

Write-Host "Get Latest Tag : git tag -l ${PackageName}_*"
$semVars = @()

Foreach ($tags in $latestTags)
if ($latestTags -and ($latestTags.Length -gt 0))
{
$semVars += $tags.Replace("${PackageName}_", "")
foreach ($tags in $latestTags)
{
$semVars += $tags.Replace("${PackageName}_", "")
}

$semVarsSorted = [AzureEngSemanticVersion]::SortVersionStrings($semVars)
Write-Host "Last Published Version $($semVarsSorted[0])"
$newVersion = [AzureEngSemanticVersion]::new($semVarsSorted[0])
}

$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()) ]"
Write-Host "Version to publish [ $($newVersion.ToString()) ]"

SetPackageVersion -PackageName $PackageName `
-Version $newVersion `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ jobs:
publishFeedCredentials: Nuget.org

- publish: '${{ parameters.ArtifactsPath }}'
displayName: Publish Packages
displayName: Upload Packages to Artifacts
artifact: packages
condition: succeeded()

0 comments on commit 9292e45

Please sign in to comment.