-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set version artificially for the test template runs (#15849)
- Loading branch information
1 parent
a8e4a8f
commit b7c32bf
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Overides the project file and CHANGELOG.md for the template project using the next publishable version | ||
# This is to help with testing the release pipeline. | ||
. "${PSScriptRoot}\..\common\scripts\common.ps1" | ||
$latestTags = git tag -l "azure-sdk-template_*" | ||
$semVars = @() | ||
|
||
$changeLogFile = "${PSScriptRoot}\..\..\sdk\template\azure-sdk-template\CHANGELOG.md" | ||
$pomFile = "${PSScriptRoot}\..\..\sdk\template\azure-sdk-template\pom.xml" | ||
|
||
Foreach ($tags in $latestTags) | ||
{ | ||
$semVars += $tags.Replace("azure-sdk-template_", "") | ||
} | ||
|
||
$semVarsSorted = [AzureEngSemanticVersion]::SortVersionStrings($semVars) | ||
LogDebug "Last Published Version $($semVarsSorted[0])" | ||
|
||
$newVersion = [AzureEngSemanticVersion]::ParseVersionString($semVarsSorted[0]) | ||
$newVersion.IncrementAndSetToPrerelease() | ||
LogDebug "Version to publish [ $($newVersion.ToString()) ]" | ||
|
||
$pomFileContent = New-Object -TypeName XML | ||
$pomFileContent.PreserveWhitespace = $true | ||
$pomFileContent.load((Resolve-Path $pomFile)) | ||
$pomFileContent.project.version = $newVersion.ToString() | ||
Set-Content -Path $pomFile -Value $pomFileContent.OuterXml | ||
Set-Content -Path $changeLogFile -Value @" | ||
# Release History | ||
## $($newVersion.ToString()) ($(Get-Date -f "yyyy-MM-dd")) | ||
- Test Release Pipeline | ||
"@ |