Skip to content

Commit

Permalink
Store release notes into Notes custom property of the issue (#14782)
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym committed Sep 2, 2020
1 parent 814b56e commit c3680c6
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions eng/scripts/Prepare-Release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"="<pre>"+$notes.Replace("`n", "<br>")+"</pre>"
}

Write-Host
Expand All @@ -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

0 comments on commit c3680c6

Please sign in to comment.