From e89d447b8fb382c7ffa3d8c669054229ad96da29 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 05:46:18 +0000 Subject: [PATCH] CI: replace release files in place instead of deleting the release Deleting and recreating launcher-qt-latest left a window with no release, so a phone checking for updates then got a 404 ("couldn't check"), and two runs racing could leave it missing. Now the APK and then version.json are uploaded over the old ones, and publishes run one at a time. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DPL5hiQsCq11CwCPnKPp9D --- .github/workflows/launcher.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/launcher.yml b/.github/workflows/launcher.yml index 1510ea7..67e1b69 100644 --- a/.github/workflows/launcher.yml +++ b/.github/workflows/launcher.yml @@ -65,7 +65,14 @@ jobs: cp android/app/build/outputs/apk/debug/app-debug.apk ultra-launcher.apk # The launcher's updater reads this to tell whether the APK is newer than it. echo '{"versionCode": ${{ github.run_number }}, "commit": "'"$GITHUB_SHA"'"}' > version.json - gh release delete launcher-latest --yes --cleanup-tag || true + # Swap the files in place, the APK first, so the release never disappears + # under a phone checking for updates. + if gh release view launcher-latest >/dev/null 2>&1; then + gh release upload launcher-latest ultra-launcher.apk --clobber + gh release upload launcher-latest version.json --clobber + git push -f "https://x-access-token:$GH_TOKEN@github.com/$GITHUB_REPOSITORY" "$GITHUB_SHA:refs/tags/launcher-latest" + exit 0 + fi gh release create launcher-latest ultra-launcher.apk version.json --prerelease --target "$GITHUB_SHA" \ --title "ultra launcher (latest build)" \ --notes "Debug-signed APK of android/ built from $GITHUB_SHA. Install it, press Home, and pick ultra Home." @@ -138,7 +145,14 @@ jobs: GH_TOKEN: ${{ github.token }} run: | echo '{"versionCode": ${{ github.run_number }}, "commit": "'"$GITHUB_SHA"'"}' > version.json - gh release delete launcher-qt-latest --yes --cleanup-tag || true + # Swap the files in place, the APK first, so the release never disappears + # under a phone checking for updates. + if gh release view launcher-qt-latest >/dev/null 2>&1; then + gh release upload launcher-qt-latest ultra-launcher.apk --clobber + gh release upload launcher-qt-latest version.json --clobber + git push -f "https://x-access-token:$GH_TOKEN@github.com/$GITHUB_REPOSITORY" "$GITHUB_SHA:refs/tags/launcher-qt-latest" + exit 0 + fi gh release create launcher-qt-latest ultra-launcher.apk version.json --prerelease --target "$GITHUB_SHA" \ --title "ultra launcher, Qt build (latest)" \ --notes "The Qt Quick rewrite (qt/), built from $GITHUB_SHA. It installs over the WebView launcher (same package and key) as \"ultra Home (Qt)\"."