From 8dfcf771785d630ed95ce3fea75763099366f9b4 Mon Sep 17 00:00:00 2001 From: David Poblador i Garcia Date: Thu, 30 Jul 2026 12:11:37 +0200 Subject: [PATCH] fix(ci): keep appcast history when a previous release has no assets The appcast merged items from whichever release was most recent, which is empty when that release's build failed. The download then failed silently and the new appcast shipped with only its own item, dropping the history the Homebrew update popover reads. This happened for 0.1.78, whose appcast lost 76 items. Walks back through recent releases until one actually yields an appcast, and warns rather than truncating quietly if none does. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01HzGnpFC9q8ydDPD8ygabKv --- .github/workflows/release.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 90e0a9d4..f9f5a4f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -257,12 +257,20 @@ jobs: exit 1 fi - # Download existing appcast from previous release to merge with (preserves items - # for the Homebrew update popover). Cannot use --latest because release-please - # already created the current (empty) release. - PREV_TAG=$(gh release list --repo "$GITHUB_REPOSITORY" --limit 10 --json tagName --jq "[.[] | select(.tagName != \"$TAG_NAME\")][0].tagName") - if [ -n "$PREV_TAG" ]; then - gh release download "$PREV_TAG" --repo "$GITHUB_REPOSITORY" --pattern "appcast.xml" --output existing-appcast.xml || true + # Download an existing appcast to merge with (preserves items for the Homebrew + # update popover). Cannot use --latest because release-please already created + # the current (empty) release. Walk back through previous releases until one + # actually yields an appcast: a release whose build failed carries no assets, + # and stopping at it would silently drop every historical item. + for CANDIDATE in $(gh release list --repo "$GITHUB_REPOSITORY" --limit 10 --json tagName --jq "[.[] | select(.tagName != \"$TAG_NAME\")][].tagName"); do + rm -f existing-appcast.xml + if gh release download "$CANDIDATE" --repo "$GITHUB_REPOSITORY" --pattern "appcast.xml" --output existing-appcast.xml 2>/dev/null; then + echo "Carrying forward appcast items from $CANDIDATE" + break + fi + done + if [ ! -f existing-appcast.xml ]; then + echo "::warning::No previous appcast found; this release's appcast will contain only its own item" fi DMG_URL="https://github.com/alltuner/factoryfloor/releases/download/v${VERSION}/${DMG_NAME}"