oficina / sheets Public

Add Sparkle updates to Oficina Sheets on macOS

Paul Campbell pushed by codex agent, operated by paul@keymail.dev f4d9f454082241ee6d53c72bbabea82676f76b31 parent b3038ce
6 files changed, +42 −12
  • native/apple/Package.resolved +17 −8
  • native/apple/Package.swift +7 −2
  • native/apple/Sources/SheetsApp/SheetsApp.swift +9 −0
  • native/ios/project.yml +1 −1
  • native/mac-updates.json +6 −0
  • native/scripts/build-mac.sh +2 −1
diff --git a/native/apple/Package.resolved b/native/apple/Package.resolved
index 64d5af2..2a9b2ab 100644
--- a/native/apple/Package.resolved
+++ b/native/apple/Package.resolved
@@ -1,14 +1,23 @@
{
- "originHash" : "95848ac3db32ddb942bdc47a84b774889b32bdbc0e52aa27bbbc232f34802013",
- "pins" : [
+ "originHash": "9d29c6ae8f4af5dee8048418fbb2bcf1e7b93e8e5686925de1e91eaeb45ea50b",
+ "pins": [
{
- "identity" : "native",
- "kind" : "remoteSourceControl",
- "location" : "https://amadan.net/rastrillo/native",
- "state" : {
- "revision" : "a49307c29cf36dff2cf423c3f98b38269ce9a553"
+ "identity": "native",
+ "kind": "remoteSourceControl",
+ "location": "https://amadan.net/rastrillo/native",
+ "state": {
+ "revision": "4c61d6283a188c95647e1d0e609e69d29c2e7fa1"
+ }
+ },
+ {
+ "identity": "sparkle",
+ "kind": "remoteSourceControl",
+ "location": "https://github.com/sparkle-project/Sparkle",
+ "state": {
+ "revision": "ac2def288cbff5cfc7df3ffef6abdf45b72bcb0a",
+ "version": "2.9.6"
}
}
],
- "version" : 3
+ "version": 3
}
diff --git a/native/apple/Package.swift b/native/apple/Package.swift
index 4dc734e..a50e12d 100644
--- a/native/apple/Package.swift
+++ b/native/apple/Package.swift
@@ -1,9 +1,14 @@
// swift-tools-version: 6.2
import PackageDescription
+import Foundation
+
+let sharedNative: Package.Dependency = ProcessInfo.processInfo.environment["OFICINA_NATIVE_PACKAGE_PATH"].map { .package(path: $0) }
+ ?? .package(url: "https://amadan.net/rastrillo/native", revision: "4c61d6283a188c95647e1d0e609e69d29c2e7fa1")
+
let package = Package(name: "SheetsNative", platforms: [.macOS(.v26), .iOS(.v26)],
products: [.library(name:"SheetsKit",targets:["SheetsKit"]), .executable(name:"SheetsMac",targets:["SheetsMac"]), .executable(name:"SheetsReview",targets:["SheetsReview"])],
- dependencies:[.package(url:"https://amadan.net/rastrillo/native",revision:"a49307c29cf36dff2cf423c3f98b38269ce9a553")],
+ dependencies:[sharedNative],
targets:[.target(name:"SheetsKit",dependencies:[.product(name:"RastrilloApple",package:"native")]),
- .executableTarget(name:"SheetsMac",dependencies:["SheetsKit",.product(name:"RastrilloApple",package:"native")],path:"Sources/SheetsApp"),
+ .executableTarget(name:"SheetsMac",dependencies:[.product(name: "RastrilloMacUpdates", package: "native", condition: .when(platforms: [.macOS])), "SheetsKit",.product(name:"RastrilloApple",package:"native")],path:"Sources/SheetsApp"),
.executableTarget(name:"SheetsReview",dependencies:["SheetsKit",.product(name:"RastrilloApple",package:"native")]),
.testTarget(name:"SheetsKitTests",dependencies:["SheetsKit"])])
diff --git a/native/apple/Sources/SheetsApp/SheetsApp.swift b/native/apple/Sources/SheetsApp/SheetsApp.swift
index 508f3a0..d4f32cd 100644
--- a/native/apple/Sources/SheetsApp/SheetsApp.swift
+++ b/native/apple/Sources/SheetsApp/SheetsApp.swift
@@ -1,8 +1,14 @@
+#if os(macOS)
+import RastrilloMacUpdates
+#endif
import RastrilloApple
import SheetsKit
import SwiftUI
@main struct SheetsApp: App {
+ #if os(macOS)
+ @State private var updater = NativeUpdater()
+ #endif
#if os(macOS)
@NSApplicationDelegateAdaptor(SheetsApplicationDelegate.self) private var appDelegate
#endif
@@ -21,5 +27,8 @@ import SwiftUI
.frame(minWidth: 760, minHeight: 600)
#endif
}
+ #if os(macOS)
+ .commands { NativeUpdateCommands(updater: updater) }
+ #endif
}
}
diff --git a/native/ios/project.yml b/native/ios/project.yml
index 953f5c6..6c6f665 100644
--- a/native/ios/project.yml
+++ b/native/ios/project.yml
@@ -8,7 +8,7 @@ packages:
path: ../apple
RastrilloNative:
url: https://amadan.net/rastrillo/native
- revision: a49307c29cf36dff2cf423c3f98b38269ce9a553
+ revision: 4c61d6283a188c95647e1d0e609e69d29c2e7fa1
settings:
base:
SWIFT_VERSION: '6.0'
diff --git a/native/mac-updates.json b/native/mac-updates.json
new file mode 100644
index 0000000..616a4e4
--- /dev/null
+++ b/native/mac-updates.json
@@ -0,0 +1,6 @@
+{
+ "bundle_id": "net.amadan.oficina.sheets",
+ "feed_url": "https://raw.amadan.net/oficina/native-releases/main/sheets/appcast.xml",
+ "public_ed_key": "/FxO7cZnM7P5c9ZrUPUJvpCnR65sNmrzte+I5vHarE8=",
+ "keychain_account": "oficina"
+}
diff --git a/native/scripts/build-mac.sh b/native/scripts/build-mac.sh
index 6c300f7..6c81843 100755
--- a/native/scripts/build-mac.sh
+++ b/native/scripts/build-mac.sh
@@ -2,4 +2,5 @@
set -eu
cd "$(dirname "$0")/.."
swift package --package-path apple resolve
-python3 apple/.build/checkouts/native/tools/bundle-mac.py . Sheets
+shared_native="${OFICINA_NATIVE_PACKAGE_PATH:-apple/.build/checkouts/native}"
+python3 "$shared_native/tools/bundle-mac.py" . Sheets "$@"