Skip to content

Commit

Permalink
[repo] Release process tweaks & improvements 2 (#5587)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch committed May 2, 2024
1 parent eace49c commit e95ae72
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion .github/workflows/publish-packages-1.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,51 @@ jobs:
if ($firstPackageVersion -eq '')
{
$firstPackageVersion = $packageVersion
$firstPackageVersion = $packageVersion
}
$changelogContent = Get-Content -Path "src/$packageName/CHANGELOG.md"
$headingWritten = $false
$started = $false
$content = ""
foreach ($line in $changelogContent)
{
if ($line -like "## ${{ github.ref_name }}" -and $started -ne $true)
{
$started = $true
}
elseif ($line -like "Released *" -and $started -eq $true)
{
continue
}
elseif ($line -like "## *" -and $started -eq $true)
{
break
}
else
{
if ($started -eq $true -and ([string]::IsNullOrWhitespace($line) -eq $false -or $content.Length -gt 0))
{
$content += " " + $line + "`r`n"
}
}
}
if ([string]::IsNullOrWhitespace($content) -eq $true)
{
$content = " No notable changes."
}
$content = $content.trimend()
$notes +=
@"
* NuGet: [$packageName v$packageVersion](https://www.nuget.org/packages/$packageName/$packageVersion)
$content
See [CHANGELOG](https://github.com/${{ github.repository }}/blob/${{ github.ref_name }}/src/$packageName/CHANGELOG.md) for details.
"@
Expand Down

0 comments on commit e95ae72

Please sign in to comment.