Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .codex/scripts/prerelease-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,19 @@ if [ -n "${GITHUB_REPOSITORY:-}" ] && [ "$RUN_ID" != "unknown" ]; then
run_detail="[${RUN_ID}](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${RUN_ID})"
fi

handoff_heading="### Thunderstore handoff"
if [ -n "${GITHUB_REPOSITORY:-}" ] && [ "$COMMIT" != "unknown" ]; then
handoff_heading="<p><img src=\"https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/${COMMIT}/.github/assets/ts_badge.png\" alt=\"Thunderstore handoff\" width=\"96\" /></p>"
fi

mkdir -p "$(dirname "$OUTPUT_PATH")"
cat > "$OUTPUT_PATH" <<EOF
## Eclipse ${VERSION} pre-release

> [!NOTE]
> This GitHub pre-release is the source artifact for the matching Thunderstore publish. Thunderstore receives package version \`${VERSION}\` from tag \`${TAG}\`.

### 📦 Thunderstore handoff
${handoff_heading}

| Signal | Detail |
| --- | --- |
Expand Down
9 changes: 8 additions & 1 deletion .codex/scripts/prerelease-notes.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ function Invoke-PrereleaseNotes {

function Test-PrereleaseNotesIncludesChangelogAndDetailsCard {
$FixtureRoot = New-Fixture
$PreviousRepository = $env:GITHUB_REPOSITORY
try {
$env:GITHUB_REPOSITORY = "mfoltz/Eclipse"
$ChangelogPath = Join-Path $FixtureRoot "CHANGELOG.md"
$OutputPath = Join-Path $FixtureRoot "prerelease-notes.md"
Set-Content -Path $ChangelogPath -Value @'
Expand Down Expand Up @@ -72,7 +74,11 @@ function Test-PrereleaseNotesIncludesChangelogAndDetailsCard {
throw "Release notes should keep the Thunderstore handoff card visible without a dropdown."
}

Assert-Match -Text $Notes -Pattern '### 📦 Thunderstore handoff' -Message "Release notes did not include the handoff card heading."
if ($Notes -match '### 📦 Thunderstore handoff') {
throw "Release notes should use the Thunderstore badge instead of the emoji heading."
}

Assert-Match -Text $Notes -Pattern '<img src="https://raw\.githubusercontent\.com/mfoltz/Eclipse/1234567890abcdef/\.github/assets/ts_badge\.png"' -Message "Release notes did not include the Thunderstore badge image."
Assert-Match -Text $Notes -Pattern '📝 Changelog' -Message "Release notes did not include the changelog cue."
Assert-Match -Text $Notes -Pattern '🌿 Branch' -Message "Release notes did not include the branch cue."
Assert-Match -Text $Notes -Pattern '🔖 Commit' -Message "Release notes did not include the commit cue."
Expand All @@ -85,6 +91,7 @@ function Test-PrereleaseNotesIncludesChangelogAndDetailsCard {
Assert-Match -Text $Notes -Pattern '1234567890ab' -Message "Release notes did not include the short commit."
}
finally {
$env:GITHUB_REPOSITORY = $PreviousRepository
Remove-Item -Recurse -Force -LiteralPath $FixtureRoot
}
}
Expand Down
Binary file added .github/assets/ts_badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading