From 472b9658d8f06529fb8af016781d657f96f2564f Mon Sep 17 00:00:00 2001 From: psavarmattas Date: Fri, 14 Aug 2026 03:10:56 +0100 Subject: [PATCH] feat(app): wire Check for Updates to releases page, add DMG packaging script About screen's "Check for Updates..." was a no-op placeholder - opens the Gitea releases page now (no Sparkle-style in-app updater yet). scripts/package-dmg.sh packages an Xcode-exported .app into a distributable DMG with an Applications symlink, versioned from the app's own Info.plist. --- Outpost/Features/About/AboutView.swift | 9 +++-- scripts/package-dmg.sh | 46 ++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100755 scripts/package-dmg.sh diff --git a/Outpost/Features/About/AboutView.swift b/Outpost/Features/About/AboutView.swift index 0fb79e5..108daa8 100644 --- a/Outpost/Features/About/AboutView.swift +++ b/Outpost/Features/About/AboutView.swift @@ -1,8 +1,10 @@ #if os(macOS) +import AppKit import SwiftUI struct AboutView: View { private let repositoryURL = URL(string: "https://git.psmattas.com/psmattas/Outpost")! + private let releasesURL = URL(string: "https://git.psmattas.com/psmattas/Outpost/releases")! private var appName: String { Bundle.main.object(forInfoDictionaryKey: "CFBundleName") as? String ?? "Outpost" @@ -71,7 +73,10 @@ struct AboutView: View { .frame(width: 320) } - // Update checking isn't wired to a distribution channel yet — button is a placeholder. - private func checkForUpdates() {} + // No Sparkle-style in-app updater yet — this just opens the releases page + // on the self-hosted Gitea instance so the user can check/download manually. + private func checkForUpdates() { + NSWorkspace.shared.open(releasesURL) + } } #endif diff --git a/scripts/package-dmg.sh b/scripts/package-dmg.sh new file mode 100755 index 0000000..336d707 --- /dev/null +++ b/scripts/package-dmg.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Packages an already-exported Outpost.app into a distributable DMG with an +# Applications-folder symlink for drag-to-install. +# +# Usage: scripts/package-dmg.sh /path/to/Outpost.app [output-dir] +# +# Produces: /Outpost-.dmg +# Version/build number are read directly from the app's own Info.plist, so +# this always matches whatever MARKETING_VERSION was set to at archive time. + +set -euo pipefail + +APP_PATH="${1:?Usage: package-dmg.sh /path/to/Outpost.app [output-dir]}" +OUT_DIR="${2:-$(pwd)/dist}" + +if [ ! -d "$APP_PATH" ]; then + echo "error: '$APP_PATH' not found or not a directory" >&2 + exit 1 +fi + +APP_NAME="$(basename "$APP_PATH" .app)" +VERSION="$(defaults read "$APP_PATH/Contents/Info" CFBundleShortVersionString)" +BUILD="$(defaults read "$APP_PATH/Contents/Info" CFBundleVersion)" + +mkdir -p "$OUT_DIR" + +STAGING_DIR="$(mktemp -d)" +trap 'rm -rf "$STAGING_DIR"' EXIT + +echo "Staging '$APP_NAME.app' ($VERSION build $BUILD)..." +cp -R "$APP_PATH" "$STAGING_DIR/" +ln -s /Applications "$STAGING_DIR/Applications" + +DMG_NAME="${APP_NAME}-${VERSION}.dmg" +DMG_PATH="$OUT_DIR/$DMG_NAME" +rm -f "$DMG_PATH" + +echo "Building $DMG_NAME..." +hdiutil create \ + -volname "$APP_NAME $VERSION" \ + -srcfolder "$STAGING_DIR" \ + -ov \ + -format UDZO \ + "$DMG_PATH" + +echo "Done: $DMG_PATH"