Skip to content

Commit 76f0a7a

Browse files
authored
Add release notes collect script (#14879)
1 parent b208eea commit 76f0a7a

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

eng/scripts/Collect-Changelogs.ps1

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[CmdletBinding()]
2+
param(
3+
[Parameter(Mandatory=$true)]
4+
[ValidateRange(1, 12)]
5+
[int] $Month
6+
)
7+
8+
$repoRoot = Resolve-Path "$PSScriptRoot/../..";
9+
. ${repoRoot}\eng\common\scripts\SemVer.ps1
10+
. ${repoRoot}\eng\common\scripts\ChangeLog-Operations.ps1
11+
$InstallNotes = "";
12+
$ReleaseNotes = "";
13+
14+
$date = Get-Date -Month $month -Format "yyyy-MM"
15+
$date += "-\d\d"
16+
17+
Get-ChildItem "$repoRoot/sdk" -Filter CHANGELOG.md -Recurse | Sort-Object -Property Name | % {
18+
19+
$changeLogEntries = Get-ChangeLogEntries -ChangeLogLocation $_
20+
$package = $_.Directory.Name
21+
$serviceDirectory = $_.Directory.Parent.Name
22+
23+
foreach ($changeLogEntry in $changeLogEntries.Values)
24+
{
25+
if ($changeLogEntry.ReleaseStatus -notmatch $date)
26+
{
27+
28+
continue;
29+
}
30+
31+
$version = $changeLogEntry.ReleaseVersion
32+
$githubAnchor = $changeLogEntry.ReleaseTitle.Replace("## ", "").Replace(".", "").Replace("(", "").Replace(")", "").Replace(" ", "-")
33+
34+
$InstallNotes += "$> dotnet add package $package --version $version`n";
35+
$ReleaseNotes += "### $package [Changelog](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/$serviceDirectory/$package/CHANGELOG.md#$githubAnchor)`n"
36+
$changeLogEntry.ReleaseContent | %{
37+
38+
$ReleaseNotes += $_.Replace("###", "####")
39+
$ReleaseNotes += "`n"
40+
}
41+
$ReleaseNotes += "`n"
42+
}
43+
}
44+
45+
return $InstallNotes, $ReleaseNotes

0 commit comments

Comments
 (0)