Skip to content

Commit

Permalink
Add Sparkle update path
Browse files Browse the repository at this point in the history
- Invoke `checkForUpdatesInBackground` when the user runs the app
- Add `SUFeedURL` to the `Info.plist`
- Add `appcast.xml` file
  • Loading branch information
zenangst committed Dec 21, 2020
1 parent 7a63bdf commit 63209e4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions App/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
<true/>
<key>com.apple.security.automation.apple-events</key>
<true/>
<key>SUFeedURL</key>
<string>https://raw.githubusercontent.com/zenangst/KeyboardCowboy/master/appcast.xml</string>
<key>SUPublicEDKey</key>
<string>ZxEpbxbd8TIwNev9bkzaLrHAaQUK/x0wBTHb4anScsc=</string>
</dict>
Expand Down
3 changes: 3 additions & 0 deletions App/Sources/Application/Saloon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import LogicFramework
import ModelKit
import ViewKit
import SwiftUI
import Sparkle

/*
This type alias exists soley to restore some order to all the chaos.
Expand Down Expand Up @@ -102,6 +103,8 @@ class Saloon: ViewKitStore, MenubarControllerDelegate {
subscribe(to: UserDefaults.standard, context: context)
subscribe(to: NotificationCenter.default)
loaded = true

SUUpdater.shared()?.checkForUpdatesInBackground()
}

func receive(_ scenePhase: ScenePhase) {
Expand Down
12 changes: 12 additions & 0 deletions appcast.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" standalone="yes"?>
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
<channel>
<title>Keyboard Cowboy</title>
<item>
<title>0.4.1</title>
<pubDate>Sun, 20 Dec 2020 19:50:28 +0100</pubDate>
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
<enclosure url="Keyboard_Cowboy_0.4.1.zip" sparkle:version="18" sparkle:shortVersionString="0.4.1" length="2871926" type="application/octet-stream"/>
</item>
</channel>
</rss>

0 comments on commit 63209e4

Please sign in to comment.