Git Product home page Git Product logo

fastlane_flutter_unity_grpc's Introduction

Flutter & Unity Sample CI (Github Action + FastLane)

Prerequisites

CheckList

Locally

  • Unity: Auto build and config iOS
  • Unity: Auto build and config Android
  • Fastlane: iOS
  • Fastlane: Android

Github Action

  • Game CI: Export unity iOS
  • Game CI: Export unity Android
  • Fastlane: iOS
  • Fastlane: Android

How it work

Create Flutter project wrap with unity modunle via flutter_unity_widget package

├─ ios
├─ android
├─ lib
  ├─ main.dart
├─ unity
  ├─ unity-project
    ├─ Assets
├─ pubspec.yaml

Setup export unity (iOS/Android) automatic via C# static function.

Create make file and prepare commend line that use unity to excuse C# function.

unity_app = /Applications/Unity/Hub/Editor/2019.4.27f1/Unity.app/Contents/MacOS/Unity
project_path = unity/unity_project/
# all: unity_ios unity_android
unity_ios:
	${unity_app} -quit -bachmode -projectPath ${project_path} -executeMethod Build.DoBuildIOS


unity_android:
	${unity_app} -quit -bachmode -projectPath ${project_path} -executeMethod Build.DoBuildAndroid

The result after export succeeded

├─ ios
  ├─ UnityLibrary
├─ android
  ├─ unityLibrary
├─ lib
  ├─ main.dart
├─ unity
  ├─ unity-project
    ├─ Assets
├─ pubspec.yaml

Fastlane

  • Setup fastlane separately for ios and android. After that we got
├─ ios
  ├─ UnityLibrary
  ├─ fastlane
  ├─ Gemfile
├─ android
  ├─ unityLibrary
  ├─ fastlane
  ├─ Gemfile
├─ lib
  ├─ main.dart
├─ unity
  ├─ unity-project
    ├─ Assets
├─ pubspec.yaml
  • Fastlane Android
  desc "Deploy Android"
  lane :firebase do
    sh "flutter build apk"
    # upload_to_play_store
  end
  • Fastlane iOS
  desc "Push a new beta build to TestFlight"
  lane :beta do
    match
    update_code_signing_settings
    build_app
    # testflight
  end

Github Action

Create 2 file to build and deploy via github action (main_android.yml & main_ios.yml)

Android steps

  1. Checkout your source code
  2. Cache Unity Library
  3. Build Unity Android
  4. Set up Flutter
  5. Fix File permission
  6. Build and deploy with Fastlane

iOS steps

Because build unity not available on macOS. So we export unity first on ubuntu I. Export Unity on Ubuntu

  1. Checkout your source code
  2. Cache Unity Library
  3. Build Unity Android
  4. Upload Build to Artifact

II. Build Flutter iOS on MacOS

  1. Checkout your source code
  2. Download Build from Artifact
  3. Set up Flutter
  4. Fix File permission
  5. Build and deploy with Fastlane

Note: After export unity. I don't know why we don't have permission to write on our source code. So we need use chmod to fix permission

fastlane_flutter_unity_grpc's People

Contributors

jimmy-to-goldenowl avatar khanhuitse05 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.