Skip to content

Commit

Permalink
Merge pull request #12 from lakshay007/master
Browse files Browse the repository at this point in the history
Added macOS build support
  • Loading branch information
lakshay007 authored Jan 8, 2025
1 parent a6154d2 commit 115b143
Show file tree
Hide file tree
Showing 12 changed files with 315 additions and 5 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,38 @@ jobs:
path: |
build/linux/x64/release/bundle/*
build-macos:
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"

- name: Install CocoaPods
run: |
sudo gem install cocoapods
- name: Build macOS
run: |
flutter config --enable-macos-desktop
flutter pub get
pod install --project-directory=macos
flutter build macos --release
- name: Save macOS app
uses: actions/upload-artifact@v4
with:
name: macos
path: build/macos/Build/Products/Release/*.app

release:
runs-on: ubuntu-latest
needs: [build-android, build-windows, build-linux]
needs: [build-android, build-windows, build-linux, build-macos]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -123,6 +152,9 @@ jobs:
- name: Zip Linux bundle
run: tar -czvf SyncVault-${{ github.ref_name }}-linux.tar.gz exec/linux

- name: Zip macOS app
run: tar -czvf SyncVault-${{ github.ref_name }}-macos.tar.gz exec/macos

- name: Display structure of downloaded files
run: tree exec/

Expand All @@ -138,7 +170,7 @@ jobs:
exec/android/flutter-apk/*
SyncVault-${{ github.ref_name }}-windows.zip
SyncVault-${{ github.ref_name }}-linux.tar.gz
exec/win/ExCode.msix
SyncVault-${{ github.ref_name }}-macos.tar.gz
body_path: CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}
env:
Expand Down
1 change: 1 addition & 0 deletions ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
44 changes: 44 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
1 change: 1 addition & 0 deletions macos/Flutter/Flutter-Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
1 change: 1 addition & 0 deletions macos/Flutter/Flutter-Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
43 changes: 43 additions & 0 deletions macos/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
platform :osx, '10.15'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end
85 changes: 85 additions & 0 deletions macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
PODS:
- desktop_webview_window (0.0.1):
- FlutterMacOS
- flutter_web_auth_2 (3.0.0):
- FlutterMacOS
- FlutterMacOS (1.0.0)
- package_info_plus (0.0.1):
- FlutterMacOS
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- screen_retriever_macos (0.0.1):
- FlutterMacOS
- Sentry/HybridSDK (8.41.0)
- sentry_flutter (8.11.0):
- Flutter
- FlutterMacOS
- Sentry/HybridSDK (= 8.41.0)
- system_tray (0.0.1):
- FlutterMacOS
- url_launcher_macos (0.0.1):
- FlutterMacOS
- window_manager (0.2.0):
- FlutterMacOS
- window_to_front (0.0.1):
- FlutterMacOS

DEPENDENCIES:
- desktop_webview_window (from `Flutter/ephemeral/.symlinks/plugins/desktop_webview_window/macos`)
- flutter_web_auth_2 (from `Flutter/ephemeral/.symlinks/plugins/flutter_web_auth_2/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- screen_retriever_macos (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos`)
- sentry_flutter (from `Flutter/ephemeral/.symlinks/plugins/sentry_flutter/macos`)
- system_tray (from `Flutter/ephemeral/.symlinks/plugins/system_tray/macos`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
- window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`)
- window_to_front (from `Flutter/ephemeral/.symlinks/plugins/window_to_front/macos`)

SPEC REPOS:
trunk:
- Sentry

EXTERNAL SOURCES:
desktop_webview_window:
:path: Flutter/ephemeral/.symlinks/plugins/desktop_webview_window/macos
flutter_web_auth_2:
:path: Flutter/ephemeral/.symlinks/plugins/flutter_web_auth_2/macos
FlutterMacOS:
:path: Flutter/ephemeral
package_info_plus:
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos
path_provider_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
screen_retriever_macos:
:path: Flutter/ephemeral/.symlinks/plugins/screen_retriever_macos/macos
sentry_flutter:
:path: Flutter/ephemeral/.symlinks/plugins/sentry_flutter/macos
system_tray:
:path: Flutter/ephemeral/.symlinks/plugins/system_tray/macos
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
window_manager:
:path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos
window_to_front:
:path: Flutter/ephemeral/.symlinks/plugins/window_to_front/macos

SPEC CHECKSUMS:
desktop_webview_window: 7e37af677d6d19294cb433d9b1d878ef78dffa4d
flutter_web_auth_2: 62b08da29f15a20fa63f144234622a1488d45b65
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
package_info_plus: f0052d280d17aa382b932f399edf32507174e870
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
screen_retriever_macos: 452e51764a9e1cdb74b3c541238795849f21557f
Sentry: 54d0fe6c0df448497c8ed4cce66ccf7027e1823e
sentry_flutter: 5ab149e838b8e2dd1b1fc51c9a79793bc2ba5512
system_tray: 53f0cdb020c3fbee711d3fe45ae7ce730e033d2b
url_launcher_macos: 0fba8ddabfc33ce0a9afe7c5fef5aab3d8d2d673
window_manager: 1d01fa7ac65a6e6f83b965471b1a7fdd3f06166c
window_to_front: 9e76fd432e36700a197dac86a0011e49c89abe0a

PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3

COCOAPODS: 1.16.2
Loading

0 comments on commit 115b143

Please sign in to comment.