Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand All @@ -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-
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/rompatch-gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/rompatch-gui/ui/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
59 changes: 38 additions & 21 deletions crates/rompatch-gui/ui/src/components/UpdateBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="flex items-center gap-3 border-b border-accent/30 bg-accent-subtle/30 px-4 py-2 text-sm">
<DownloadIcon size={16} className="text-accent" />
<span className="flex-1">
Update available: <span className="font-medium">v{status.update.version}</span>
</span>
<Button size="sm" variant="primary" onClick={() => void install(status.update)}>
Install &amp; restart
</Button>
<div className={SHELL}>
<div className="flex items-start gap-3">
<DownloadIcon size={16} className="mt-0.5 text-accent" />
<div className="flex-1 min-w-0">
<div className="text-sm font-semibold text-fg">New update available</div>
<div className="text-xs text-fg-muted mt-0.5">
Version {status.update.version} - install now or later?
</div>
</div>
</div>
<div className="mt-3 flex justify-end gap-2">
<Button size="sm" variant="ghost" onClick={dismiss}>
Later
</Button>
<Button size="sm" variant="primary" onClick={() => void install(status.update)}>
Install now
</Button>
</div>
</div>
);
}
Expand All @@ -33,25 +44,31 @@ export function UpdateBanner() {
? Math.min(100, Math.round((status.downloaded / status.contentLength) * 100))
: null;
return (
<div className="flex items-center gap-3 border-b border-accent/30 bg-accent-subtle/30 px-4 py-2 text-sm">
<RefreshIcon size={16} className="text-accent animate-spin" />
<span className="flex-1">
Downloading update{pct != null ? ` (${pct}%)` : ''} - {formatBytes(status.downloaded)}
{status.contentLength != null ? ` / ${formatBytes(status.contentLength)}` : ''}
</span>
<div className={SHELL}>
<div className="flex items-center gap-3">
<RefreshIcon size={16} className="text-accent animate-spin" />
<div className="flex-1 min-w-0 text-sm text-fg">
Downloading update{pct != null ? ` (${pct}%)` : ''}
<div className="text-xs text-fg-muted mt-0.5">
{formatBytes(status.downloaded)}
{status.contentLength != null ? ` / ${formatBytes(status.contentLength)}` : ''}
</div>
</div>
</div>
</div>
);
}

if (status.kind === 'ready') {
return (
<div className="flex items-center gap-3 border-b border-accent/30 bg-accent-subtle/30 px-4 py-2 text-sm">
<RefreshIcon size={16} className="text-accent" />
<span className="flex-1">Update installed - restarting...</span>
<div className={SHELL}>
<div className="flex items-center gap-3">
<RefreshIcon size={16} className="text-accent" />
<div className="flex-1 min-w-0 text-sm text-fg">Update installed - restarting...</div>
</div>
</div>
);
}

// error
return null;
}
9 changes: 8 additions & 1 deletion crates/rompatch-gui/ui/src/lib/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}
2 changes: 1 addition & 1 deletion crates/rompatch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Loading