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
{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}{update.error ?? "Your usage database and preferences stay in place."}
{update.busy ?