mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-10-31 16:23:03 +00:00
feat(desktop): show what's changed in auto-update prompt
Publish HEALTHCHAT_CHANGES.md release notes into the update feeds so users see what changed. macOS gets them natively via releases.json's notes field; Windows fetches a published notes.txt, since Squirrel.Windows only delivers releaseName through the update-downloaded event.
This commit is contained in:
@@ -231,6 +231,12 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
# Needed so the staging step can read HEALTHCHAT_CHANGES.md to extract release notes.
|
||||
# Lands at the workspace root; download-artifact below writes to dist-artifacts/, no conflict.
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Download all build artifacts
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
|
||||
with:
|
||||
@@ -269,11 +275,36 @@ jobs:
|
||||
- name: Stage update feed + public installers
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# --- Release notes: extract this version's section from HEALTHCHAT_CHANGES.md ---
|
||||
# Same extraction as build-healthchat.yaml (web). Surfaced to desktop users in the
|
||||
# auto-update "See changes" dialog: macOS reads it from releases.json's `notes`
|
||||
# field natively, Windows fetches notes.txt (Squirrel.Windows can't carry notes
|
||||
# through the update-downloaded event — only releaseName is available).
|
||||
VERSION="${GITHUB_REF_NAME#healthchat-v}"
|
||||
NOTES=$(awk -v ver="$VERSION" '
|
||||
/^## Changes in / {
|
||||
if (found) { exit }
|
||||
if ($0 ~ "## Changes in " ver "( |$|\\()") { found = 1; next }
|
||||
}
|
||||
found { print }
|
||||
' HEALTHCHAT_CHANGES.md | sed '/^[[:space:]]*$/{N;/^\n$/D;}')
|
||||
if [[ -z "$NOTES" ]]; then
|
||||
NOTES="HealthChat ${VERSION} — automated build from ${GITHUB_REF_NAME}."
|
||||
echo "::warning::No HEALTHCHAT_CHANGES.md section found for $VERSION — using fallback"
|
||||
fi
|
||||
printf '%s\n' "$NOTES" > notes.txt
|
||||
echo "--- release notes ---"; cat notes.txt
|
||||
|
||||
# --- macOS update feed: releases.json (Squirrel.Mac manifest) + signed *-mac.zip payload ---
|
||||
mkdir -p feed/update/macos feed/install/macos
|
||||
test -f dist-artifacts/macos/releases.json || {
|
||||
echo "::error::dist-artifacts/macos/releases.json missing (did the macos job get base-url?)"; exit 1; }
|
||||
cp -v dist-artifacts/macos/releases.json feed/update/macos/
|
||||
# Splice the notes into the manifest: Squirrel.Mac maps updateTo.notes -> the
|
||||
# update-downloaded event's releaseNotes, which the renderer already renders.
|
||||
jq --rawfile notes notes.txt '.releases[0].updateTo.notes = $notes' \
|
||||
feed/update/macos/releases.json > feed/update/macos/releases.json.tmp
|
||||
mv feed/update/macos/releases.json.tmp feed/update/macos/releases.json
|
||||
find dist-artifacts/macos -type f -iname '*-mac.zip' -exec cp -v {} feed/update/macos/ \;
|
||||
# --- macOS installer: versioned .dmg + a stable "latest" copy ---
|
||||
find dist-artifacts/macos -type f -iname '*.dmg' -exec cp -v {} feed/install/macos/ \;
|
||||
@@ -284,6 +315,9 @@ jobs:
|
||||
src="dist-artifacts/win-$arch"
|
||||
[ -d "$src" ] || { echo "::error::$src missing"; exit 1; }
|
||||
mkdir -p "feed/update/win32/$arch" "feed/install/win32/$arch"
|
||||
# Side-channel for release notes: the desktop main process fetches this and
|
||||
# populates releaseNotes itself, since Squirrel.Windows can't deliver them.
|
||||
cp -v notes.txt "feed/update/win32/$arch/notes.txt"
|
||||
find "$src" -type f -iname 'RELEASES' -exec cp -v {} "feed/update/win32/$arch/" \;
|
||||
find "$src" -type f -iname '*-full.nupkg' -exec cp -v {} "feed/update/win32/$arch/" \;
|
||||
find "$src" -type f -iname '* Setup*.exe' -exec cp -v {} "feed/install/win32/$arch/" \;
|
||||
|
||||
Reference in New Issue
Block a user