From dd7cb5844ad2ef5e4e154b1ab00a65229ba90704 Mon Sep 17 00:00:00 2001 From: wrestle-R Date: Wed, 25 Nov 2026 10:30:27 +0530 Subject: [PATCH] added dated release history and a download zip --- tauri/scripts/publish-linux-release.sh | 14 ++++++++++---- tauri/src/components/app-updates.tsx | 14 +++++++++----- tauri/src/hooks/use-release-notice.ts | 6 ++++++ tauri/src/lib/releases.json | 10 ++++++++++ 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/tauri/scripts/publish-linux-release.sh b/tauri/scripts/publish-linux-release.sh index 0630ff1..16778df 100644 --- a/tauri/scripts/publish-linux-release.sh +++ b/tauri/scripts/publish-linux-release.sh @@ -27,14 +27,20 @@ for (const file of process.argv.slice(2)) { } JS node scripts/updater-manifest.mjs "$bundle/appimage" "$version" --check -notes="$(mktemp)" -trap 'rm -f "$notes"' EXIT +release_dir="$(mktemp -d)" +trap 'rm -rf -- "$release_dir"' EXIT +notes="$release_dir/notes.md" +archive="$release_dir/HyprTrack.Desktop_${version}_linux-x86_64.zip" +python3 -m zipfile -c "$archive" "${assets[@]}" +python3 -m zipfile -t "$archive" +(cd "$release_dir" && sha256sum "$(basename "$archive")" > "$(basename "$archive").sha256") +assets+=("$archive" "$archive.sha256") RELEASE_NOTES="$notes" node --input-type=module <<'JS' import fs from 'node:fs' const version = process.env.RELEASE_TAG.slice(1) const entry = JSON.parse(fs.readFileSync('src/lib/releases.json', 'utf8')).find(r => r.version === version) if (!entry) throw Error('Missing release notes') -fs.writeFileSync(process.env.RELEASE_NOTES, [entry.title, '', ...entry.highlights.map(s => `- ${s}`), '', 'Linux network capture needs the one-time NetHogs setup described in the README. Signed in-app updates are available for AppImage installations.', ''].join('\n')) +fs.writeFileSync(process.env.RELEASE_NOTES, [entry.title, '', `Release date · ${entry.date}`, '', ...entry.highlights.map(s => `- ${s}`), '', 'Linux network capture needs the one-time NetHogs setup described in the README. Signed in-app updates are available for AppImage installations.', ''].join('\n')) JS if gh release view "$tag" --json isDraft >/dev/null 2>&1; then @@ -54,5 +60,5 @@ for asset in "${assets[@]}"; do done [[ "$uploaded" == true ]] || exit 1 done -[[ "$(gh release view "$tag" --json assets --jq '.assets | length')" == 6 ]] +[[ "$(gh release view "$tag" --json assets --jq '.assets | length')" == "${#assets[@]}" ]] gh release edit "$tag" --draft=false diff --git a/tauri/src/components/app-updates.tsx b/tauri/src/components/app-updates.tsx index bceda97..744aa50 100644 --- a/tauri/src/components/app-updates.tsx +++ b/tauri/src/components/app-updates.tsx @@ -1,6 +1,6 @@ import { useEffect, useRef, useState } from "react" import type { AppUpdateState } from "../hooks/use-app-update" -import type { ReleaseNotice } from "../hooks/use-release-notice" +import { installedReleaseHistory, type ReleaseNotice } from "../hooks/use-release-notice" import "./app-updates.css" function progressLabel(update: AppUpdateState) { @@ -14,7 +14,9 @@ function progressLabel(update: AppUpdateState) { export function UpdateControl({ update, compact = false }: { update: AppUpdateState; compact?: boolean }) { const [open, setOpen] = useState(false) + const [showHistory, setShowHistory] = useState(false) if (compact && !update.availableVersion && !update.busy) return null + const history = compact ? null : installedReleaseHistory(update.info.version) const percent = update.progress?.total ? Math.min(100, Math.round(update.progress.downloaded / update.progress.total * 100)) : null const install = () => { setOpen(true); void update.install() } return
@@ -23,9 +25,11 @@ export function UpdateControl({ update, compact = false }: { update: AppUpdateSt

{update.availableVersion ? `Version ${update.availableVersion} is ready.` : update.checking ? "Checking for updates…" : update.checked && update.info.updateSupported ? "You have the latest published version." : "Updates are checked when the app opens."}

{!update.info.updateSupported ?

In-app installation is available in the Linux AppImage. Update DEB/RPM packages through your package manager.

: null}
+ {history && } {update.availableVersion ? : null}
} + {showHistory && history && setShowHistory(false)} />} {(compact ? open : true) && (update.busy || update.error) ?
{update.error ? "Could not complete the update" : progressLabel(update)}

{update.error ?? "Your usage database and preferences stay in place."}

{update.busy ?
: null} @@ -34,7 +38,7 @@ export function UpdateControl({ update, compact = false }: { update: AppUpdateSt
} -export function ReleaseNoticeDialog({ notice, onDismiss }: { notice: ReleaseNotice; onDismiss: () => void }) { +export function ReleaseNoticeDialog({ notice, history = false, onDismiss }: { notice: ReleaseNotice; history?: boolean; onDismiss: () => void }) { const dialog = useRef(null) const closeButton = useRef(null) useEffect(() => { @@ -44,12 +48,12 @@ export function ReleaseNoticeDialog({ notice, onDismiss }: { notice: ReleaseNoti return () => element?.close() }, []) return { event.preventDefault(); onDismiss() }}> -

Updated to v{notice.version}

What’s new in HyprTrack

-

{notice.previousVersion ? `Changes since v${notice.previousVersion}.` : "Here’s what changed in this release."} {notice.releases.length > 1 ? `${notice.releases.length} updates included.` : ""}

+

{history ? "Installed" : "Updated to"} v{notice.version}

{history ? "Release history" : "What’s new in HyprTrack"}

+ {!history &&

{notice.previousVersion ? `Changes since v${notice.previousVersion}.` : "Here’s what changed in this release."} {notice.releases.length > 1 ? `${notice.releases.length} updates included.` : ""}

}
{notice.releases.map(release =>
v{release.version}

{release.title}

    {release.highlights.map(highlight =>
  • {highlight}
  • )}
)}
-
These notes won’t appear again for this version.
+
{!history && Find these notes again in Settings.}
} diff --git a/tauri/src/hooks/use-release-notice.ts b/tauri/src/hooks/use-release-notice.ts index 3074d55..384b40a 100644 --- a/tauri/src/hooks/use-release-notice.ts +++ b/tauri/src/hooks/use-release-notice.ts @@ -11,6 +11,12 @@ function compare(a: string, b: string) { return 0 } +export function installedReleaseHistory(version: string): ReleaseNotice | null { + if (!/^\d+\.\d+\.\d+$/.test(version)) return null + const installed = releases.filter(release => compare(release.version, version) <= 0) + return installed.length ? { version, previousVersion: null, releases: installed } : null +} + export function consumeReleaseNotice(version: string, storage: Storage, hasExistingActivity = false): ReleaseNotice | null { if (!/^\d+\.\d+\.\d+$/.test(version)) return null try { diff --git a/tauri/src/lib/releases.json b/tauri/src/lib/releases.json index 2310cfe..f055037 100644 --- a/tauri/src/lib/releases.json +++ b/tauri/src/lib/releases.json @@ -1,4 +1,14 @@ [ + { + "version": "2.2.3", + "date": "2026-11-25", + "title": "Safer network capture and release history", + "highlights": [ + "The network helper checks permissions before setting capture capabilities, and the collector uses the trusted helper path.", + "Choose Release history in Settings to see what changed in each installed version.", + "Download the Linux packages, signatures and checksums together as a ZIP." + ] + }, { "version": "2.2.2", "date": "2026-10-27",