Commit Graph
8 Commits
Author SHA1 Message Date
7418 c14fdb07ae fix: resolve mac updater no-response by shipping zip and surfacing errors 2026-02-27 14:35:22 +08:00
7418andClaude Opus 4.6 762953b2ad feat: integrate electron-updater for in-app auto-update
Replace the manual "jump to GitHub Release" update flow with native
in-app auto-update powered by electron-updater. The app now silently
downloads updates in the background and prompts the user to restart
when ready. Browser mode (`npm run dev`) retains the existing polling
fallback via `/api/app/updates`.

Main process (electron/updater.ts — new):
- Wrap electron-updater's autoUpdater, forward lifecycle events
  (checking / available / downloading / downloaded / error) to the
  renderer via IPC channel `updater:status`
- Register `updater:check` and `updater:quit-and-install` IPC handlers
- Auto-check 10s after launch, then every 4 hours
- Only initialized in packaged mode (!isDev)

Preload bridge (electron/preload.ts):
- Expose `updater` namespace with checkForUpdates, quitAndInstall,
  and onStatus callback (same pattern as install.onProgress)

Type declarations (src/types/electron.d.ts):
- Add UpdateStatusEvent, ElectronUpdaterAPI interfaces
- Add optional `updater` field to ElectronAPI

Update hook (src/hooks/useUpdate.ts):
- Extend UpdateInfo with downloadProgress, readyToInstall, isNativeUpdate
- Add quitAndInstall to UpdateContextValue

Renderer — dual-mode logic (src/components/layout/AppShell.tsx):
- Detect `window.electronAPI?.updater` to choose between native IPC
  subscription (Electron) and HTTP polling (browser)
- Map IPC events to UpdateInfo state, including download progress

UI components:
- UpdateDialog: three footer states — View Release (browser), progress
  bar + disabled button (downloading), Restart to Update (ready)
- UpdateBanner (new): persistent top banner when update is downloaded,
  shown even after dialog is dismissed
- NavRail: settings dot turns green + pulse when readyToInstall
- GeneralSection: UpdateCard shows download %, restart button, or
  View Release depending on mode

Build & CI:
- electron-builder.yml: add `publish` config (github provider) to
  generate latest-mac.yml / latest.yml metadata + blockmap files
- build.yml: change --publish never to --publish always with GH_TOKEN;
  release job now uses `gh release edit` instead of create

i18n:
- Add 6 translation keys (en + zh) for update UI strings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 11:16:41 +08:00
7418andClaude Opus 4.6 d2c6964fd8 fix: CI changelog echo breaks on special chars in commit messages
Use heredoc instead of single-quoted echo to write changelog into
release notes, preventing shell syntax errors from quotes/pipes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:47:43 +08:00
7418andClaude Opus 4.6 41f08c37cf fix(ci): add author/description for Linux deb/rpm, allow partial release
Linux deb/rpm packaging requires maintainer email. Also make release
job run even if some platform builds fail (e.g. partial release with
available artifacts).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 22:24:32 +08:00
7418andClaude Opus 4.6 3e56d358b7 ci: publish release directly instead of draft
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 22:04:46 +08:00
7418andClaude Opus 4.6 a346ef230b ci: auto-create GitHub Release on tag push
When a v* tag is pushed, all platforms build in parallel then
a release job collects artifacts and creates a draft GitHub
Release with changelog and download instructions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 22:03:48 +08:00
7418andClaude Opus 4.6 5d80969b3b fix(ci): add --publish never and simplify Windows matrix
electron-builder auto-publishes in CI without GH_TOKEN, causing
failure. Also remove redundant Windows arch matrix since NSIS
bundles both x64 and arm64 in a single installer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 21:56:23 +08:00
7418andClaude Opus 4.6 57f1679585 ci: add GitHub Actions workflow for multi-platform builds
Supports Windows (NSIS), macOS (DMG), and Linux (AppImage/deb/rpm)
builds via native runners. Triggered manually or on version tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 21:50:46 +08:00