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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiQsCq11CwCPnKPp9D
This commit is contained in:
Claude committed 2026-11-02 05:46:18 +00:00
1 parent 41f4a05a90
commit e89d447b8f
1 file changed
+16 -2
+16 -2
View File
@@ -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)\"."