Skip to content

Commit 0d95ef8

Browse files
authored
DMG release + auto update setup (#3538)
* desktop updater setup * setup dmg + gh release codemagic flow * hardcode ver for testing * notarize * fix notarisation * use issuer instead of issuer-id * add logging to test * more logging and use correct cert * fix cert type * use MAC_APP_DIRECT cert * test * set password empty * skip automatic signing * double sign * sign dmg * remove sign in entitlement * typo * remove sandbox * hardcode team id and bundle id * i hate apple * use provisioning profile * use provision profile from env * remove apple sign in entitlement * last attempt * don't resign * verify with timestamp * simplify signing * misc * use xcode us eprofiles * simplify workflow * fix yaml * manual sign * decode the provisioning profile before using * use-profiles * verbose logging * should work now * don't force * remove get-task-allow * force * entitlements * use sparkle * sign sparkle and related components * fix tag * fix sparkle signing * fix sparkle key import * sign directly using sparkle * use signed urls + cleanup the workflow now that it works flawlessly * change url for update testing * beautify dmg + bump ver for update testing * fix version in appcast xml * pass skip-jenkins for finder timeout * remove debug echos from flow and cleanup * dmg ux improvements + new route to download latest release * upload update zip to gh directly * remove test ver
1 parent 6d4244c commit 0d95ef8

File tree

11 files changed

+1150
-32
lines changed

11 files changed

+1150
-32
lines changed

app/ios/Podfile.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ PODS:
1616
- Flutter
1717
- connectivity_plus (0.0.1):
1818
- Flutter
19+
- cryptography_flutter_plus (0.2.0):
20+
- Flutter
1921
- device_info_plus (0.0.1):
2022
- Flutter
2123
- DKImagePickerController/Core (4.3.9):
@@ -275,6 +277,7 @@ DEPENDENCIES:
275277
- awesome_notifications (from `.symlinks/plugins/awesome_notifications/ios`)
276278
- awesome_notifications_core (from `.symlinks/plugins/awesome_notifications_core/ios`)
277279
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
280+
- cryptography_flutter_plus (from `.symlinks/plugins/cryptography_flutter_plus/ios`)
278281
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
279282
- file_picker (from `.symlinks/plugins/file_picker/ios`)
280283
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
@@ -362,6 +365,8 @@ EXTERNAL SOURCES:
362365
:path: ".symlinks/plugins/awesome_notifications_core/ios"
363366
connectivity_plus:
364367
:path: ".symlinks/plugins/connectivity_plus/ios"
368+
cryptography_flutter_plus:
369+
:path: ".symlinks/plugins/cryptography_flutter_plus/ios"
365370
device_info_plus:
366371
:path: ".symlinks/plugins/device_info_plus/ios"
367372
file_picker:
@@ -444,6 +449,7 @@ SPEC CHECKSUMS:
444449
awesome_notifications: 0f432b28098d193920b11a44cfa9d2d9313a3888
445450
awesome_notifications_core: 429c28df8746780a474de177e5acde33af87da63
446451
connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd
452+
cryptography_flutter_plus: 44f4e9e4079395fcbb3e7809c0ac2c6ae2d9576f
447453
device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
448454
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
449455
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60

app/lib/main.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import 'package:omi/providers/sync_provider.dart';
4747
import 'package:omi/providers/usage_provider.dart';
4848
import 'package:omi/providers/user_provider.dart';
4949
import 'package:omi/services/auth_service.dart';
50+
import 'package:omi/services/desktop_update_service.dart';
5051
import 'package:omi/services/notifications.dart';
5152
import 'package:omi/services/notifications/action_item_notification_handler.dart';
5253
import 'package:omi/services/services.dart';
@@ -162,6 +163,11 @@ Future _init() async {
162163
return true;
163164
};
164165

166+
// Initialize desktop updater
167+
if (PlatformService.isDesktop) {
168+
await DesktopUpdateService().initialize();
169+
}
170+
165171
await ServiceManager.instance().start();
166172
return;
167173
}
@@ -238,7 +244,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
238244
try {
239245
final context = MyApp.navigatorKey.currentContext;
240246
if (context == null) return;
241-
247+
242248
final captureProvider = Provider.of<CaptureProvider>(context, listen: false);
243249
if (captureProvider.recordingState == RecordingState.stop) {
244250
await captureProvider.streamSystemAudioRecording();
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import 'dart:io';
2+
import 'package:auto_updater/auto_updater.dart';
3+
import 'package:omi/env/env.dart';
4+
import 'package:omi/utils/logger.dart';
5+
import 'package:omi/utils/platform/platform_service.dart';
6+
7+
/// Service to manage desktop application updates using auto_updater
8+
class DesktopUpdateService {
9+
static final DesktopUpdateService _instance = DesktopUpdateService._internal();
10+
factory DesktopUpdateService() => _instance;
11+
DesktopUpdateService._internal();
12+
13+
bool _initialized = false;
14+
15+
String get _platform {
16+
if (Platform.isMacOS) return 'macos';
17+
if (Platform.isWindows) return 'windows';
18+
if (Platform.isLinux) return 'linux';
19+
return 'unknown';
20+
}
21+
22+
/// Initialize auto_updater
23+
Future<void> initialize() async {
24+
if (!PlatformService.isDesktop) {
25+
Logger.debug('Desktop updater not supported on this platform');
26+
return;
27+
}
28+
29+
if (_initialized) {
30+
Logger.debug('Desktop updater already initialized');
31+
return;
32+
}
33+
34+
try {
35+
final baseUrl = Env.apiBaseUrl;
36+
final feedURL = '${baseUrl}v2/desktop/appcast.xml?platform=$_platform';
37+
38+
// Configure auto_updater
39+
await autoUpdater.setFeedURL(feedURL);
40+
await autoUpdater.setScheduledCheckInterval(10800); // Check every 3 hours
41+
42+
// Check for updates in background on startup
43+
await autoUpdater.checkForUpdates(inBackground: true);
44+
45+
_initialized = true;
46+
} catch (e, stackTrace) {
47+
Logger.handle(e, stackTrace, message: 'Failed to initialize auto updater');
48+
}
49+
}
50+
51+
/// Manually check for updates
52+
Future<void> checkForUpdates() async {
53+
if (!_initialized) {
54+
Logger.warning('Auto updater not initialized');
55+
return;
56+
}
57+
58+
try {
59+
await autoUpdater.checkForUpdates();
60+
} catch (e, stackTrace) {
61+
Logger.handle(e, stackTrace, message: 'Failed to check for updates');
62+
}
63+
}
64+
65+
bool get isAvailable => _initialized;
66+
}

app/macos/Podfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ target 'Runner' do
3333
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
3434

3535
pod 'Mixpanel-swift', :git => 'https://github.com/beastoin/mixpanel-swift.git', :commit => '5fd6584'
36+
pod 'Sparkle', '~> 2.0'
3637
end
3738

3839
post_install do |installer|

app/macos/Runner/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@
9797
<false/>
9898
<key>PermissionGroupNotification</key>
9999
<string>You need to enable notifications to receive your pro-active feedback.</string>
100-
<key>com.apple.security.app-sandbox</key>
101-
<true/>
102100
<key>com.apple.security.device.audio-input</key>
103101
<true/>
104102
<key>com.apple.security.files.user-selected.read-only</key>
@@ -110,5 +108,7 @@
110108
</array>
111109
<key>ITSAppUsesNonExemptEncryption</key>
112110
<false/>
111+
<key>SUPublicEDKey</key>
112+
<string>EYZ94JfSI+WJzZMRUizMwCaQXuB2/EjTSZ382u9XukQ=</string>
113113
</dict>
114114
</plist>

app/pubspec.lock

Lines changed: 84 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ packages:
6969
dependency: transitive
7070
description:
7171
name: archive
72-
sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d
72+
sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd"
7373
url: "https://pub.dev"
7474
source: hosted
75-
version: "3.6.1"
75+
version: "4.0.7"
7676
args:
7777
dependency: transitive
7878
description:
@@ -105,6 +105,38 @@ packages:
105105
url: "https://pub.dev"
106106
source: hosted
107107
version: "3.0.0"
108+
auto_updater:
109+
dependency: "direct main"
110+
description:
111+
name: auto_updater
112+
sha256: "74fd008b021d15e4fc50fb5f1923870e6374ae831bb1168241c23bc35a4e898b"
113+
url: "https://pub.dev"
114+
source: hosted
115+
version: "1.0.0"
116+
auto_updater_macos:
117+
dependency: transitive
118+
description:
119+
name: auto_updater_macos
120+
sha256: ef9de0daf38d782d2243fe131503a9404d62df762f5386e5360020e43c01867f
121+
url: "https://pub.dev"
122+
source: hosted
123+
version: "1.0.0"
124+
auto_updater_platform_interface:
125+
dependency: transitive
126+
description:
127+
name: auto_updater_platform_interface
128+
sha256: ed5dff8cea18c58bc5ac787ff9122fedd1644272e02015d28c9b592f8078c5dc
129+
url: "https://pub.dev"
130+
source: hosted
131+
version: "1.0.0"
132+
auto_updater_windows:
133+
dependency: transitive
134+
description:
135+
name: auto_updater_windows
136+
sha256: "2bba20a71eee072f49b7267fedd5c4f1406c4b1b1e5b83932c634dbab75b80c9"
137+
url: "https://pub.dev"
138+
source: hosted
139+
version: "1.0.0"
108140
awesome_notifications:
109141
dependency: "direct main"
110142
description:
@@ -679,10 +711,10 @@ packages:
679711
dependency: "direct dev"
680712
description:
681713
name: flutter_flavorizr
682-
sha256: e9550f67a890b9111ac5a555954f3808cb8c0132ce6dea08e3381964de39b906
714+
sha256: "7ac1a53e95d36e96017bbf4aa94023dc652e455de3f0ce9c80e9eaa274c73e81"
683715
url: "https://pub.dev"
684716
source: hosted
685-
version: "2.2.3"
717+
version: "2.4.1"
686718
flutter_foreground_task:
687719
dependency: "direct main"
688720
description:
@@ -829,10 +861,11 @@ packages:
829861
frame_sdk:
830862
dependency: "direct main"
831863
description:
832-
name: frame_sdk
833-
sha256: afab5eede530d4f215d88bc8eb84d6b0944907bcbde58eee662253029392463b
834-
url: "https://pub.dev"
835-
source: hosted
864+
path: "."
865+
ref: master
866+
resolved-ref: "78d8ad55354e30759243e29e793f0981f9aa317d"
867+
url: "https://github.com/mdmohsin7/frame-sdk-flutter.git"
868+
source: git
836869
version: "0.0.7"
837870
frontend_server_client:
838871
dependency: transitive
@@ -955,10 +988,10 @@ packages:
955988
dependency: "direct main"
956989
description:
957990
name: googleapis_auth
958-
sha256: af7c3a3edf9d0de2e1e0a77e994fae0a581c525fa7012af4fa0d4a52ed9484da
991+
sha256: b81fe352cc4a330b3710d2b7ad258d9bcef6f909bb759b306bf42973a7d046db
959992
url: "https://pub.dev"
960993
source: hosted
961-
version: "1.4.1"
994+
version: "2.0.0"
962995
gradient_borders:
963996
dependency: "direct main"
964997
description:
@@ -1043,10 +1076,10 @@ packages:
10431076
dependency: "direct main"
10441077
description:
10451078
name: image
1046-
sha256: f31d52537dc417fdcde36088fdf11d191026fd5e4fae742491ebd40e5a8bea7d
1079+
sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928"
10471080
url: "https://pub.dev"
10481081
source: hosted
1049-
version: "4.3.0"
1082+
version: "4.5.4"
10501083
image_picker:
10511084
dependency: "direct main"
10521085
description:
@@ -1197,13 +1230,13 @@ packages:
11971230
source: hosted
11981231
version: "1.0.5"
11991232
js:
1200-
dependency: transitive
1233+
dependency: "direct overridden"
12011234
description:
12021235
name: js
1203-
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
1236+
sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc"
12041237
url: "https://pub.dev"
12051238
source: hosted
1206-
version: "0.6.7"
1239+
version: "0.7.2"
12071240
json_annotation:
12081241
dependency: "direct main"
12091242
description:
@@ -1296,10 +1329,10 @@ packages:
12961329
dependency: "direct main"
12971330
description:
12981331
name: lottie
1299-
sha256: "377d87b8dcef640c04717e93afb86a510f0e1117a399ab94dc4b3f39c85eaa87"
1332+
sha256: "8ae0be46dbd9e19641791dc12ee480d34e1fd3f84c749adc05f3ad9342b71b95"
13001333
url: "https://pub.dev"
13011334
source: hosted
1302-
version: "3.3.0"
1335+
version: "3.3.2"
13031336
map_launcher:
13041337
dependency: "direct main"
13051338
description:
@@ -1316,6 +1349,14 @@ packages:
13161349
url: "https://pub.dev"
13171350
source: hosted
13181351
version: "7.3.0"
1352+
mason_logger:
1353+
dependency: transitive
1354+
description:
1355+
name: mason_logger
1356+
sha256: "6d5a989ff41157915cb5162ed6e41196d5e31b070d2f86e1c2edf216996a158c"
1357+
url: "https://pub.dev"
1358+
source: hosted
1359+
version: "0.3.3"
13191360
matcher:
13201361
dependency: transitive
13211362
description:
@@ -1368,10 +1409,11 @@ packages:
13681409
mixpanel_flutter:
13691410
dependency: "direct main"
13701411
description:
1371-
name: mixpanel_flutter
1372-
sha256: "0ecd870cceed1cf4600c403e5544b88efa65b8fd3f30fad679702d1ae9e0ac15"
1373-
url: "https://pub.dev"
1374-
source: hosted
1412+
path: "."
1413+
ref: f9234e9
1414+
resolved-ref: f9234e9e4f94f9f24b88f3775230c11a734ed7cd
1415+
url: "https://github.com/beastoin/mixpanel-flutter.git"
1416+
source: git
13751417
version: "2.4.4"
13761418
nested:
13771419
dependency: transitive
@@ -1408,10 +1450,11 @@ packages:
14081450
opus_dart:
14091451
dependency: "direct main"
14101452
description:
1411-
name: opus_dart
1412-
sha256: e8ab4774409997af33cbfdfe91a186854ed6458b2fec66b0e52f4434b1af2f7c
1413-
url: "https://pub.dev"
1414-
source: hosted
1453+
path: "."
1454+
ref: dev
1455+
resolved-ref: e2202b0f38cf6c9e70ab7807b4cdaa3304b145ec
1456+
url: "https://github.com/mdmohsin7/opus_dart.git"
1457+
source: git
14151458
version: "3.0.1"
14161459
opus_flutter:
14171460
dependency: "direct main"
@@ -1679,6 +1722,14 @@ packages:
16791722
url: "https://pub.dev"
16801723
source: hosted
16811724
version: "1.5.1"
1725+
posix:
1726+
dependency: transitive
1727+
description:
1728+
name: posix
1729+
sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61"
1730+
url: "https://pub.dev"
1731+
source: hosted
1732+
version: "6.0.3"
16821733
process:
16831734
dependency: transitive
16841735
description:
@@ -2284,6 +2335,14 @@ packages:
22842335
url: "https://pub.dev"
22852336
source: hosted
22862337
version: "15.0.2"
2338+
wasm_ffi:
2339+
dependency: transitive
2340+
description:
2341+
name: wasm_ffi
2342+
sha256: f4539052e4d80575bb4820c836a2d6400af061b71c1605af60ebfb30b7c5369a
2343+
url: "https://pub.dev"
2344+
source: hosted
2345+
version: "2.0.7"
22872346
watcher:
22882347
dependency: transitive
22892348
description:

0 commit comments

Comments
 (0)