Skip to content

Commit e95ae72

Browse files
authored
[repo] Release process tweaks & improvements 2 (#5587)
1 parent eace49c commit e95ae72

1 file changed

Lines changed: 39 additions & 1 deletion

File tree

.github/workflows/publish-packages-1.0.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,51 @@ jobs:
7373
7474
if ($firstPackageVersion -eq '')
7575
{
76-
$firstPackageVersion = $packageVersion
76+
$firstPackageVersion = $packageVersion
7777
}
7878
79+
$changelogContent = Get-Content -Path "src/$packageName/CHANGELOG.md"
80+
81+
$headingWritten = $false
82+
$started = $false
83+
$content = ""
84+
85+
foreach ($line in $changelogContent)
86+
{
87+
if ($line -like "## ${{ github.ref_name }}" -and $started -ne $true)
88+
{
89+
$started = $true
90+
}
91+
elseif ($line -like "Released *" -and $started -eq $true)
92+
{
93+
continue
94+
}
95+
elseif ($line -like "## *" -and $started -eq $true)
96+
{
97+
break
98+
}
99+
else
100+
{
101+
if ($started -eq $true -and ([string]::IsNullOrWhitespace($line) -eq $false -or $content.Length -gt 0))
102+
{
103+
$content += " " + $line + "`r`n"
104+
}
105+
}
106+
}
107+
108+
if ([string]::IsNullOrWhitespace($content) -eq $true)
109+
{
110+
$content = " No notable changes."
111+
}
112+
113+
$content = $content.trimend()
114+
79115
$notes +=
80116
@"
81117
* NuGet: [$packageName v$packageVersion](https://www.nuget.org/packages/$packageName/$packageVersion)
82118
119+
$content
120+
83121
See [CHANGELOG](https://github.com/${{ github.repository }}/blob/${{ github.ref_name }}/src/$packageName/CHANGELOG.md) for details.
84122
85123
"@

0 commit comments

Comments
 (0)