Skip to content

Commit

Permalink
Adding the auto updater feature using sparkle (#15)
Browse files Browse the repository at this point in the history
* Adding first steps for auto update

* Updating pods and appcast

* Pointing the app to the right appcast location

* Adding small documentation
  • Loading branch information
Mattcbr authored Apr 8, 2022
1 parent f032064 commit 28b94e9
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .updates/appcast.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" standalone="yes"?>
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
<channel>
<title>Mockingbird</title>
<item>
<title>1.4.0</title>
<pubDate>Wed, 30 Mar 2022 17:05:55 +0100</pubDate>
<sparkle:version>7</sparkle:version>
<sparkle:shortVersionString>1.4.0</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>10.13</sparkle:minimumSystemVersion>
<enclosure url="https://github.com/Farfetch/mockingbird/releases/download/1.4.0/Mockingbird_1.4.0.zip" length="23444158" type="application/octet-stream"/>
</item>
</channel>
</rss>
6 changes: 6 additions & 0 deletions src/Mockingbird/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Cocoa
import Sparkle

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
Expand Down Expand Up @@ -50,4 +51,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {

func applicationWillResignActive(_ aNotification: Notification) {
}

/// This function is called when the user selects "Check for updates" on the mockingbird menu
@IBAction func checkForUpdates(_ sender: Any) {
SUUpdater.shared().checkForUpdates(nil)
}
}
13 changes: 11 additions & 2 deletions src/Mockingbird/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15702"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -23,6 +23,13 @@
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
<menuItem title="Check For Updates" id="BR4-BX-ZbZ" userLabel="Check for Updates">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="checkForUpdates:" target="Voe-Tx-rLC" id="z7c-fq-lPQ"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="ZOP-bL-P7l"/>
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
<menuItem title="Services" id="NMo-om-nkz">
Expand Down Expand Up @@ -65,6 +72,7 @@
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="Mockingbird" customModuleProvider="target"/>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
<userDefaultsController representsSharedInstance="YES" id="wT5-XR-ave"/>
</objects>
<point key="canvasLocation" x="75" y="0.0"/>
</scene>
Expand All @@ -87,6 +95,7 @@
</connections>
</windowController>
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
<customObject id="uA1-QN-sOZ" customClass="SUUpdater"/>
</objects>
<point key="canvasLocation" x="75" y="250"/>
</scene>
Expand Down
4 changes: 4 additions & 0 deletions src/Mockingbird/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,9 @@
<true/>
<key>NSSupportsSuddenTermination</key>
<true/>
<key>SUFeedURL</key>
<string>https://raw.githubusercontent.com/Farfetch/mockingbird/master/.updates/appcast.xml</string>
<key>SUPublicEDKey</key>
<string>CDw2xInMlNL3hNPLvGXwXrclHyDR95zQD7lC7rNw/5M=</string>
</dict>
</plist>
1 change: 1 addition & 0 deletions src/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ target 'Mockingbird' do
pod 'ReSwift', '~> 5.0.0'
pod 'Files', '~> 4.0.2'
pod 'AppCenter', '~> 4.0.0'
pod 'Sparkle', '~> 2.0.0'

target 'MockingbirdTests' do
inherit! :search_paths
Expand Down
8 changes: 6 additions & 2 deletions src/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ PODS:
- AppCenter/Core
- Files (4.0.2)
- ReSwift (5.0.0)
- Sparkle (2.0.0)
- Starscream (4.0.4)
- Swifter (1.5.0)
- SwiftGui (0.9.2)
Expand All @@ -18,6 +19,7 @@ DEPENDENCIES:
- AppCenter (~> 4.0.0)
- Files (~> 4.0.2)
- ReSwift (~> 5.0.0)
- Sparkle (~> 2.0.0)
- Starscream (~> 4.0.4)
- Swifter (~> 1.5.0)
- SwiftGui (~> 0.9.2)
Expand All @@ -28,6 +30,7 @@ SPEC REPOS:
- AppCenter
- Files
- ReSwift
- Sparkle
- Starscream
- Swifter
- SwiftGui
Expand All @@ -37,11 +40,12 @@ SPEC CHECKSUMS:
AppCenter: 51351e0121e40ba75e28ecb7de5c2e69d480df5e
Files: d88e31b84d65e754935053b1c584ea8e2320698a
ReSwift: 628f1a9b3ee52e3b3ca2a644435472fd77afafe1
Sparkle: 128c668ddd0780beb08576ce18460d2a37f64f9f
Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9
Swifter: e71dd674404923d7f03ebb03f3f222d1c570bc8e
SwiftGui: 081f72b4dabff4ffb9af254650ec8baa17ec1949
Zip: 8877eede3dda76bcac281225c20e71c25270774c

PODFILE CHECKSUM: cce932a11f55655ec0a468e71a9e74a9f2cdf490
PODFILE CHECKSUM: 87cf72e3243b2d531ec820ad25bb43df0b92e391

COCOAPODS: 1.11.2
COCOAPODS: 1.11.3

0 comments on commit 28b94e9

Please sign in to comment.