diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a330189..e406605 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,6 +164,12 @@ jobs: TARBALL=$(basename "$TARBALL_PATH") SIG=$(cat "$TARBALL_PATH.sig") URL="https://github.com/${{ github.repository }}/releases/download/${GITHUB_REF_NAME}/${TARBALL}" + # Tauri's updater matches the manifest's `platforms` map against + # the running process's target triple (darwin-aarch64 on Apple + # Silicon, darwin-x86_64 on Intel) - "darwin-universal" alone is + # not enough, the lookup misses on real Macs. Emit all three keys + # pointing at the same universal .app.tar.gz so both architectures + # resolve and the universal fallback exists too. jq -n \ --arg v "$VERSION" \ --arg sig "$SIG" \ @@ -173,7 +179,11 @@ jobs: version: $v, notes: $notes, pub_date: (now | todate), - platforms: { "darwin-universal": { signature: $sig, url: $url } } + platforms: { + "darwin-aarch64": { signature: $sig, url: $url }, + "darwin-x86_64": { signature: $sig, url: $url }, + "darwin-universal":{ signature: $sig, url: $url } + } }' > latest.json cat latest.json # Sigstore-backed build provenance attestation. Free, transparency- diff --git a/Cargo.lock b/Cargo.lock index 953b546..5469d1d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2710,7 +2710,7 @@ dependencies = [ [[package]] name = "rompatch" -version = "0.2.1" +version = "0.2.2" dependencies = [ "lexopt", "rompatch-core", @@ -2718,7 +2718,7 @@ dependencies = [ [[package]] name = "rompatch-core" -version = "0.2.1" +version = "0.2.2" dependencies = [ "adler2", "bzip2-rs", @@ -2731,7 +2731,7 @@ dependencies = [ [[package]] name = "rompatch-gui" -version = "0.2.1" +version = "0.2.2" dependencies = [ "rompatch-core", "serde", diff --git a/Cargo.toml b/Cargo.toml index 34ad432..7848930 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = ["crates/rompatch-core", "crates/rompatch", "crates/rompatch-gui"] exclude = ["fuzz"] [workspace.package] -version = "0.2.1" +version = "0.2.2" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/GregTheGreek/rompatch-rs" diff --git a/crates/rompatch-gui/Cargo.toml b/crates/rompatch-gui/Cargo.toml index 491751b..a14a09c 100644 --- a/crates/rompatch-gui/Cargo.toml +++ b/crates/rompatch-gui/Cargo.toml @@ -14,7 +14,7 @@ crate-type = ["rlib"] tauri-build = { version = "=2.6.1", features = [] } [dependencies] -rompatch-core = { version = "=0.2.1", path = "../rompatch-core", features = ["serde"] } +rompatch-core = { version = "=0.2.2", path = "../rompatch-core", features = ["serde"] } serde = { version = "=1.0.228", features = ["derive"] } serde_json = "=1.0.149" sha2 = "=0.10.9" diff --git a/crates/rompatch-gui/ui/package.json b/crates/rompatch-gui/ui/package.json index c364a5f..1d43140 100644 --- a/crates/rompatch-gui/ui/package.json +++ b/crates/rompatch-gui/ui/package.json @@ -1,6 +1,6 @@ { "name": "rompatch-ui", - "version": "0.2.1", + "version": "0.2.2", "description": "React frontend for the rompatch native GUI", "private": true, "type": "module", diff --git a/crates/rompatch-gui/ui/src/components/UpdateBanner.tsx b/crates/rompatch-gui/ui/src/components/UpdateBanner.tsx index 8da736a..700cf5a 100644 --- a/crates/rompatch-gui/ui/src/components/UpdateBanner.tsx +++ b/crates/rompatch-gui/ui/src/components/UpdateBanner.tsx @@ -8,21 +8,32 @@ function formatBytes(bytes: number): string { return `${(bytes / 1024 / 1024).toFixed(1)} MB`; } -export function UpdateBanner() { - const { status, install } = useUpdater(); +const SHELL = + 'pointer-events-auto fixed bottom-4 left-4 z-50 w-72 rounded-xl border border-bg-border bg-bg-raised px-4 py-3 shadow-soft animate-slide-up'; - if (status.kind === 'idle' || status.kind === 'checking') return null; +export function UpdateBanner() { + const { status, install, dismiss } = useUpdater(); if (status.kind === 'available') { return ( -
- - - Update available: v{status.update.version} - - +
+
+ +
+
New update available
+
+ Version {status.update.version} - install now or later? +
+
+
+
+ + +
); } @@ -33,25 +44,31 @@ export function UpdateBanner() { ? Math.min(100, Math.round((status.downloaded / status.contentLength) * 100)) : null; return ( -
- - - Downloading update{pct != null ? ` (${pct}%)` : ''} - {formatBytes(status.downloaded)} - {status.contentLength != null ? ` / ${formatBytes(status.contentLength)}` : ''} - +
+
+ +
+ Downloading update{pct != null ? ` (${pct}%)` : ''} +
+ {formatBytes(status.downloaded)} + {status.contentLength != null ? ` / ${formatBytes(status.contentLength)}` : ''} +
+
+
); } if (status.kind === 'ready') { return ( -
- - Update installed - restarting... +
+
+ +
Update installed - restarting...
+
); } - // error return null; } diff --git a/crates/rompatch-gui/ui/src/lib/updater.ts b/crates/rompatch-gui/ui/src/lib/updater.ts index 8af2b05..bd08c62 100644 --- a/crates/rompatch-gui/ui/src/lib/updater.ts +++ b/crates/rompatch-gui/ui/src/lib/updater.ts @@ -63,5 +63,12 @@ export function useUpdater() { } } - return { status, install }; + function dismiss() { + // Stays dismissed for this process lifetime. The check only runs in the + // mount effect, so on next app launch the popup will return if there + // is still an update available. + setStatus({ kind: 'idle' }); + } + + return { status, install, dismiss }; } diff --git a/crates/rompatch/Cargo.toml b/crates/rompatch/Cargo.toml index 4ffb961..122dade 100644 --- a/crates/rompatch/Cargo.toml +++ b/crates/rompatch/Cargo.toml @@ -11,7 +11,7 @@ name = "rompatch" path = "src/main.rs" [dependencies] -rompatch-core = { path = "../rompatch-core", version = "0.2.1" } +rompatch-core = { path = "../rompatch-core", version = "0.2.2" } lexopt = "0.3" [lints]