From c3680c6c10f1feb7a83fa185ed256cbdef466143 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 2 Sep 2020 09:25:35 -0700 Subject: [PATCH] Store release notes into Notes custom property of the issue (#14782) --- eng/scripts/Prepare-Release.ps1 | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/eng/scripts/Prepare-Release.ps1 b/eng/scripts/Prepare-Release.ps1 index 29682e0d0943..046f5c32764f 100644 --- a/eng/scripts/Prepare-Release.ps1 +++ b/eng/scripts/Prepare-Release.ps1 @@ -191,7 +191,7 @@ foreach ($item in $workItems) $id = $item.fields."System.ID"; $title = $item.fields."System.Title"; $path = $item.fields."System.IterationPath"; - Write-Host "$id - $path - $title" + Write-Host "$id - $path - $title" } # Sort using fuzzy match @@ -205,12 +205,21 @@ if (!$issueId) $issueId = $mostProbable.fields."System.ID" } +$changeLogEntry = Get-ChangeLogEntry -ChangeLogLocation "$packageDirectory/CHANGELOG.md" -VersionString $newVersion + +$githubAnchor = $changeLogEntry.ReleaseTitle.Replace("## ", "").Replace(".", "").Replace("(", "").Replace(")", "").Replace(" ", "-") + +$notes = "> dotnet add package $package --version $newVersion`n`n"; +$notes += "### $package [Changelog](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/$serviceDirectory/$package/CHANGELOG.md#$githubAnchor)`n" +$changeLogEntry.ReleaseContent | %{ $notes += "$_`n" } + $fields = @{ "Permalink usetag"="https://github.com/Azure/azure-sdk-for-net/sdk/$serviceDirectory/$package/README.md" "Package Registry Permalink"="https://nuget.org/packages/$package/$newVersion" "Library Type"=$libraryType "Release Type"=$releaseType "Version Number"=$newVersion + "Notes"="
"+$notes.Replace("`n", "
")+"
" } Write-Host @@ -232,12 +241,6 @@ if ($decision -eq 0) } } -$changeLogEntry = Get-ChangeLogEntry -ChangeLogLocation "$packageDirectory/CHANGELOG.md" -VersionString $newVersion - -$githubAnchor = $changeLogEntry.ReleaseTitle.Replace("## ", "").Replace(".", "").Replace("(", "").Replace(")", "").Replace(" ", "-") Write-Host Write-Host "Snippet for the centralized CHANGELOG:" -ForegroundColor Green -Write-Host "dotnet add package $package --version $newVersion" -Write-Host "### $package [Changelog](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/$serviceDirectory/$package/CHANGELOG.md#$githubAnchor)" -$changeLogEntry.ReleaseContent | Write-Host - +Write-Host $notes \ No newline at end of file