Skip to content

Commit 352ba14

Browse files
bones7456claude
andcommitted
Inline release notes in appcast so Sparkle stops loading the GitHub site
Previously the appcast carried <sparkle:releaseNotesLink> pointing to the GitHub release tag page. Sparkle's webview rendered the entire GitHub site chrome (header, sign-in button, nav) inside the update prompt, burying the actual notes below the fold. Now the workflow asks the GitHub API to generate-notes for the tag, renders the markdown to HTML via the /markdown endpoint, and the packager inlines that HTML into the appcast as a <description> CDATA block. A <sparkle:fullReleaseNotesLink> is kept so users still have a "More…" path to the GitHub release page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b856644 commit 352ba14

2 files changed

Lines changed: 46 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ jobs:
5757
security set-key-partition-list -S apple-tool:,apple:,codesign: \
5858
-s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" >/dev/null
5959
60-
- name: Build, sign, notarize, and package
61-
run: ./scripts/package_release.sh
62-
6360
- name: Resolve tag
6461
id: resolve_tag
6562
run: |
@@ -69,14 +66,42 @@ jobs:
6966
echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
7067
fi
7168
69+
- name: Generate release notes
70+
id: notes
71+
env:
72+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
TAG: ${{ steps.resolve_tag.outputs.tag }}
74+
run: |
75+
set -euo pipefail
76+
NOTES_MD="$RUNNER_TEMP/release_notes.md"
77+
NOTES_HTML="$RUNNER_TEMP/release_notes.html"
78+
79+
gh api -X POST "/repos/${{ github.repository }}/releases/generate-notes" \
80+
-f tag_name="$TAG" \
81+
--jq .body > "$NOTES_MD"
82+
83+
gh api -X POST /markdown \
84+
-F text=@"$NOTES_MD" \
85+
-f mode=gfm \
86+
-f context="${{ github.repository }}" > "$NOTES_HTML"
87+
88+
echo "notes_md=$NOTES_MD" >> "$GITHUB_OUTPUT"
89+
echo "notes_html=$NOTES_HTML" >> "$GITHUB_OUTPUT"
90+
91+
- name: Build, sign, notarize, and package
92+
env:
93+
SPARKLE_RELEASE_NOTES_FILE: ${{ steps.notes.outputs.notes_html }}
94+
run: ./scripts/package_release.sh
95+
7296
- name: Upload artifacts to GitHub Release
7397
env:
7498
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7599
TAG: ${{ steps.resolve_tag.outputs.tag }}
100+
NOTES_MD: ${{ steps.notes.outputs.notes_md }}
76101
run: |
77102
set -euo pipefail
78103
if ! gh release view "$TAG" >/dev/null 2>&1; then
79-
gh release create "$TAG" --title "Notchy $TAG" --generate-notes
104+
gh release create "$TAG" --title "Notchy $TAG" --notes-file "$NOTES_MD"
80105
fi
81106
ASSETS=(dist/Notchy-*.zip dist/Notchy-*.dmg)
82107
if [ -f dist/appcast.xml ]; then

scripts/package_release.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ set -euo pipefail
2525
# skipped with a warning.
2626
# SPARKLE_VERSION Optional. Sparkle release tag to download tools
2727
# from. Defaults to 2.9.2.
28+
# SPARKLE_RELEASE_NOTES_FILE
29+
# Optional. Path to an HTML file with rendered
30+
# release notes. When set, its content is inlined
31+
# into appcast.xml as <description><![CDATA[...]]>
32+
# so the Sparkle prompt displays the notes
33+
# directly instead of loading an external URL.
2834
#
2935
# Behavior:
3036
# - If SIGNING_IDENTITY is unset, the .app is built but left ad-hoc-signed
@@ -220,6 +226,11 @@ if [ -n "${SPARKLE_PRIVATE_KEY:-}" ]; then
220226
ZIP_URL="https://github.com/bones7456/notchy/releases/download/v${MARKETING_VERSION}/${BASENAME}.zip"
221227
MIN_OS="$(/usr/libexec/PlistBuddy -c 'Print :LSMinimumSystemVersion' "$BUILT_APP/Contents/Info.plist" 2>/dev/null || echo "")"
222228

229+
NOTES_HTML=""
230+
if [ -n "${SPARKLE_RELEASE_NOTES_FILE:-}" ] && [ -f "$SPARKLE_RELEASE_NOTES_FILE" ]; then
231+
NOTES_HTML="$(cat "$SPARKLE_RELEASE_NOTES_FILE")"
232+
fi
233+
223234
echo "==> Writing $APPCAST_PATH"
224235
{
225236
printf '<?xml version="1.0" encoding="utf-8"?>\n'
@@ -231,7 +242,12 @@ if [ -n "${SPARKLE_PRIVATE_KEY:-}" ]; then
231242
printf ' <title>Version %s</title>\n' "$MARKETING_VERSION"
232243
printf ' <sparkle:version>%s</sparkle:version>\n' "$MARKETING_VERSION"
233244
printf ' <sparkle:shortVersionString>%s</sparkle:shortVersionString>\n' "$MARKETING_VERSION"
234-
printf ' <sparkle:releaseNotesLink>https://github.com/bones7456/notchy/releases/tag/v%s</sparkle:releaseNotesLink>\n' "$MARKETING_VERSION"
245+
if [ -n "$NOTES_HTML" ]; then
246+
printf ' <description><![CDATA[\n'
247+
printf '%s' "$NOTES_HTML"
248+
printf '\n]]></description>\n'
249+
fi
250+
printf ' <sparkle:fullReleaseNotesLink>https://github.com/bones7456/notchy/releases/tag/v%s</sparkle:fullReleaseNotesLink>\n' "$MARKETING_VERSION"
235251
printf ' <pubDate>%s</pubDate>\n' "$PUB_DATE"
236252
if [ -n "$MIN_OS" ]; then
237253
printf ' <sparkle:minimumSystemVersion>%s</sparkle:minimumSystemVersion>\n' "$MIN_OS"

0 commit comments

Comments
 (0)