From d3e0523d4b7dcfcd4a13075ccf54fc2d750099c4 Mon Sep 17 00:00:00 2001 From: Tyler South Date: Tue, 15 Sep 2026 21:18:42 -0400 Subject: [PATCH 1/2] Source release notes from the changelog --- .github/workflows/release.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 41a0949d..ee146854 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -263,6 +263,21 @@ jobs: "$env:RELEASE_ASSETS_DIR\Ceiling-$env:RELEASE_VERSION-portable.exe", "$env:RELEASE_ASSETS_DIR\Ceiling-$env:RELEASE_VERSION-portable.exe.sha256" ) + $changelog = Get-Content CHANGELOG.md -Raw + $heading = "## [Ceiling] $($env:RELEASE_VERSION)" + $pattern = "(?ms)^" + [regex]::Escape($heading) + "[^\r\n]*\r?\n.*?(?=^## |\z)" + $section = [regex]::Match($changelog, $pattern) + if (-not $section.Success) { + throw "CHANGELOG.md has no section for $($env:RELEASE_VERSION); the release notes come from the changelog." + } + $notes = $section.Value.Trim() + $previousTag = (git describe --tags --abbrev=0 "$tag^" 2>$null) + if ($LASTEXITCODE -eq 0 -and $previousTag) { + $notes += "`n`n**Full Changelog**: https://github.com/$env:GITHUB_REPOSITORY/compare/$previousTag...$tag" + } + $notesPath = Join-Path $env:RUNNER_TEMP "release-notes.md" + Set-Content -Path $notesPath -Value $notes -Encoding utf8 + $releaseJson = gh release view $tag --json isDraft --repo $env:GITHUB_REPOSITORY 2>$null if ($LASTEXITCODE -eq 0) { $release = $releaseJson | ConvertFrom-Json @@ -270,11 +285,12 @@ jobs: throw "Refusing to replace assets on published release $tag." } gh release upload $tag @assets --clobber --repo $env:GITHUB_REPOSITORY + gh release edit $tag --notes-file $notesPath --title "Ceiling $env:RELEASE_VERSION" --repo $env:GITHUB_REPOSITORY } else { gh release create $tag @assets ` --verify-tag ` --draft ` - --generate-notes ` + --notes-file $notesPath ` --title "Ceiling $env:RELEASE_VERSION" ` --repo $env:GITHUB_REPOSITORY } From 371c3299f0a26ee3408db658ae6adcdc959d3a34 Mon Sep 17 00:00:00 2001 From: Tyler South Date: Tue, 15 Sep 2026 21:23:17 -0400 Subject: [PATCH 2/2] Check release upload and edit exit codes --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee146854..4714b2f7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -285,7 +285,13 @@ jobs: throw "Refusing to replace assets on published release $tag." } gh release upload $tag @assets --clobber --repo $env:GITHUB_REPOSITORY + if ($LASTEXITCODE -ne 0) { + throw "Failed to upload assets to draft release $tag." + } gh release edit $tag --notes-file $notesPath --title "Ceiling $env:RELEASE_VERSION" --repo $env:GITHUB_REPOSITORY + if ($LASTEXITCODE -ne 0) { + throw "Failed to update draft release $tag." + } } else { gh release create $tag @assets ` --verify-tag `