Skip to content

Commit

Permalink
feat: macos support & app store ci
Browse files Browse the repository at this point in the history
  • Loading branch information
TomBursch committed Aug 17, 2021
1 parent 94c413b commit a7b7e01
Show file tree
Hide file tree
Showing 35 changed files with 1,437 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/deploy_app_store.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy to Play Store
on:
workflow_dispatch:
# Enable manual run
inputs:
lane:
description: "Fastlane lane to use (beta)"
required: true
default: "beta"

jobs:
fastlane-deploy:
runs-on: macos-10.15
steps:
# Set up Flutter.
- name: Clone Flutter repository with stable channel
uses: subosito/flutter-action@v1
with:
channel: stable
- run: flutter doctor -v

# Checkout gallery code and get packages.
- name: Checkout code
uses: actions/checkout@v2
- run: flutter packages get
- run: pod install
working-directory: ios

# Setup Ruby, Bundler, and Gemfile dependencies
- name: Setup Fastlane
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
bundler-cache: true
working-directory: ios

- name: Create .env file
run: touch .env

# Build and deploy with Fastlane (by default, to internal track) 🚀.
# Naturally, promote_to_production only deploys.
- run: bundle exec fastlane ${{ github.event.inputs.lane || 'beta' }}
env:
FASTLANE_PASSWORD: ${{ secrets.APP_STORE_PASSWORD }}
FASTLANE_USER: ${{ secrets.APP_STORE_EMAIL }}
working-directory: ios
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
target: [Windows, Linux, Android, Debian]
target: [macOS, Windows, Linux, Android, Debian]
include:
- os: macos-10.15 # Catalina
target: macOS
Expand Down
2 changes: 2 additions & 0 deletions ios/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ Runner/GeneratedPluginRegistrant.*
!default.mode2v3
!default.pbxuser
!default.perspectivev3

fastlane/report.xml
3 changes: 3 additions & 0 deletions ios/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem "fastlane"
2 changes: 1 addition & 1 deletion ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -566,4 +566,4 @@
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
}
8 changes: 8 additions & 0 deletions ios/fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
app_identifier("com.tombursch.kitchenowl") # The bundle identifier of your app
apple_id(ENV['FASTLANE_USER']) # Your Apple email address

itc_team_id(ENV['APP_STORE_TEAM_ID']) # App Store Connect Team ID
team_id(ENV['DEVELOPER_TEAM_ID']) # Developer Portal Team ID

# For more information about the Appfile, see:
# https://docs.fastlane.tools/advanced/#appfile
28 changes: 28 additions & 0 deletions ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)

platform :ios do
desc "Push a new beta build to TestFlight"
lane :beta do
sh "flutter build ios --release --no-codesign"
build_app(workspace: "Runner.xcworkspace", scheme: "Runner", export_method: "app-store")
upload_to_testflight
end
lane :test do
build_app(workspace: "Runner.xcworkspace", scheme: "Runner", export_method: "app-store")
end
end
34 changes: 34 additions & 0 deletions ios/fastlane/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
fastlane documentation
================
# Installation

Make sure you have the latest version of the Xcode command line tools installed:

```
xcode-select --install
```

Install _fastlane_ using
```
[sudo] gem install fastlane -NV
```
or alternatively using `brew install fastlane`

# Available Actions
## iOS
### ios beta
```
fastlane ios beta
```
Push a new beta build to TestFlight
### ios test
```
fastlane ios test
```


----

This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
6 changes: 6 additions & 0 deletions macos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Flutter-related
**/Flutter/ephemeral/
**/Pods/

# Xcode-related
**/xcuserdata/
2 changes: 2 additions & 0 deletions macos/Flutter/Flutter-Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
2 changes: 2 additions & 0 deletions macos/Flutter/Flutter-Release.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
40 changes: 40 additions & 0 deletions macos/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
platform :osx, '10.11'

# 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__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end
Loading

0 comments on commit a7b7e01

Please sign in to comment.