Slide 1

Slide 1 text

1 Scalable and cloud-native mobile game CI/CD environment using Unity Tadashi Nemoto CircleCI Senior Solutions Engineer

Slide 2

Slide 2 text

2 Self-introduction ● Tadashi Nemoto ● Senior Solutions Engineer, CircleCI ● Career ○ SET(Software Engineer in Test) at C2C marketplace app company ○ DevOps Engineer at AI startup company tadashi0713 tadashi-nemoto tadashi0713.dev

Slide 3

Slide 3 text

3 About this session Developing continuously high-quality mobile games, with their frequent updates and large user bases, requires the use of good CI/CD (Continuous Integration / Continuous Delivery) tools and practices. However, the unique and complex requirements of building, testing, and deploying mobile games make configuring mobile CI/CD from scratch a daunting task. This session provides an easy-to-follow introduction to creating a scalable and cloud-native mobile game CI/CD environment using CircleCI, GameCI, and Unity. This approach will provide you with the following benefits and ultimately enable you to continuously deliver high-quality mobile games by: ● Increasing developer productivity and reducing maintenance overheads with scalable, on-demand, pre-configured build environments in the cloud, including M1 Mac. ● Reducing maintenance overheads by eliminating the need for complex custom build scripts

Slide 4

Slide 4 text

4 Agenda ● Importance and Challenges of CI/CD in Mobile Game Development ● Unity Mobile Game CI/CD Pipeline using GameCI, fastlane, and CircleCI(Overview) ● How to create CI/CD pipeline step by step ● Summary

Slide 5

Slide 5 text

5 Importance and Challenges of CI/CD in Mobile Game Development

Slide 6

Slide 6 text

6 https://app.sensortower.com/top-charts

Slide 7

Slide 7 text

7 ● Can update software with low cost ● Retention rate is important for success ● Continuous quality improvements for various devices Important to provide and improve features quickly and continuously CI/CD(Continuous Integration/Continuous Delivery) is essential Key points to make your mobile games successful

Slide 8

Slide 8 text

8 Challenges of Mobile Gaming CI/CD ● Managing build fleet (especially Mac for iOS builds) ○ Requires machines with high specs ○ Provision and maintain Mac hardware ■ Buy your own, or use cloud providers with limitations ○ Regularly updating macOS and Xcode ● Difficulties setting up CI/CD pipelines ○ Installing Unity Editor ○ Activating Unity License ○ Preparing build scripts(build & distribute for each platform)

Slide 9

Slide 9 text

9 モバイルゲームCI/CDに起きがちな課題 ● 実行するビルドマシン(特にiOSビルドに必要なmac) ○ スペックの高いマシンが必要 ○ macハードウェアの用意・メンテナンス ■ 自前で購入 or 制限のあるクラウド ○ macOS・Xcodeの定期的なアップデート ● CI/CDパイプラインのセットアップの難易度 ○ Unity Editor のインストール ○ ライセンスのアクティベート ○ スクリプト(各プラットフォームへのビルド・配信)の準備 ● CI/CD is not yet implemented ○ Builds and tests are run on local machines ● Managing on-prem environments(e.g. Jenkins) ○ High maintenance costs ○ Unable to scale development ○ Low developer productivity ■ Slow build speed, Unstable build, Poor debugging experience ○ Unsuitable for remote development

Slide 10

Slide 10 text

10 Unity Mobile Game CI/CD Pipeline using GameCI, fastlane, and CircleCI(Overview)

Slide 11

Slide 11 text

11 GameCI ● Open Source Project ○ https://game.ci/ ● CI/CD setup and maintenance for Unity project is challenging ○ Installing Unity Editor ○ Activating Unity License ○ Build settings per platform ● GameCI makes it easy to implement these ● Supports CircleCI, GitHub Actions, and GitLab CI

Slide 12

Slide 12 text

12 GameCI Docker Image CircleCI Orb(reusable config package)

Slide 13

Slide 13 text

13 fastlane ● Open Source Project written in Ruby ○ https://fastlane.tools/ ● Help automate tasks specific to mobile app development ● Supports running tests, taking screenshots, iOS code signing(fastlane match), builds, distributing debug/beta versions, and releasing apps on the App Store/Play Store ● Mainly used for mobile app development(iOS/Android/React Native/Flutter), but can also be used for mobile game development

Slide 14

Slide 14 text

14 Creation Orchestration Operations Collaborate Source Control CircleCI Deliver Build • Test • Deliver・Release Run Monitor • Operate SHIP TO PRODUCTION CODE COMMIT

Slide 15

Slide 15 text

15 Powerful resource classes for gaming CI/CD https://circleci.com/product/features/resource-classes/ Maintenance-free and on-demand machines are available

Slide 16

Slide 16 text

16 CircleCI provides powerful and constantly updated (macOS and Xcode) Mac environment ● CircleCI provides Apple Silicon Mac(M1 Mac) from 2023 Up to 2x faster build speed than Intel Mac ● Not guaranteed in SLA, but we aim to support a new Xcode within a couple of days. ○ https://circleci.com/docs/xcode-policy/ Powerful resource classes for mobile CI/CD(Mac) Intel Mac M1(Apple Silicon) Mac

Slide 17

Slide 17 text

17 CircleCI provides powerful and constantly updated (macOS and Xcode) Mac environment ● CircleCI provides Apple Silicon Mac(M1 Mac) from 2023 Up to 2x faster build speed than Intel Mac ● Not guaranteed in SLA, but we aim to support a new Xcode within a couple of days. ○ https://circleci.com/docs/xcode-policy/ Powerful resource classes for mobile CI/CD(Mac) Intel Mac M1(Apple Silicon) Mac ● Various build environments for game development ● No maintenance required(especially for Macs) ● Automatically scales as needed ● Charged based on build time and the resource class of the build (Time not spent executing builds is not subject to billing)

Slide 18

Slide 18 text

18 How to create CI/CD pipeline step by step

Slide 19

Slide 19 text

19 Activating your Unity license ● Activation varies depending on the license used ○ https://game.ci/docs/circleci/activation/ ● In this example, we are using a personal license

Slide 20

Slide 20 text

20 Activating your Unity license License file https://license.unity3d.com/manual ● Activation varies depending on the license used ○ https://game.ci/docs/circleci/activation/ ● In this example, we are using a personal license

Slide 21

Slide 21 text

21 Storing License Files(CircleCI Context) ● UNITY_ENCODED_LICENSE is the license file obtained earlier, encrypted with base64

Slide 22

Slide 22 text

22 Build & Distribute for Android Platform

Slide 23

Slide 23 text

23 Build & Distribute for Android Platform .apk

Slide 24

Slide 24 text

24 CPU / RAM Usage

Slide 25

Slide 25 text

25 Build & Distribute for Android Platform

Slide 26

Slide 26 text

26 Build & Distribute for iOS Platform

Slide 27

Slide 27 text

27 Build & Distribute for iOS Platform

Slide 28

Slide 28 text

28 Build & Distribute for iOS Platform ● Previous Job just generated an Xcode project from a Unity project ● You can generate a binary for an iOS application (.ipa) by building this Xcode project in a macOS environment in which Xcode is installed Xcode Build

Slide 29

Slide 29 text

29 Build & Distribute for iOS Platform

Slide 30

Slide 30 text

30 Build & Distribute for iOS Platform https://github.com/tadashi0713/circleci-demo-mobile-unity/blob/master/fastlane/Fastfile

Slide 31

Slide 31 text

31 ● Cloud-native mobile game CI/CD environment using Unity ○ https://circleci.com/blog/unity-mobile-cicd/ ● github.com/tadashi0713/circleci-demo-mobile-unity

Slide 32

Slide 32 text

32 Summary

Slide 33

Slide 33 text

33 Summary ● CI/CD is essential for continuous development of mobile games with high release frequency ● CI/CD in mobile games tends to be a challenge in terms of build machines to run(especially Mac) and difficulty of setup ● Unity mobile game CI/CD pipeline using GameCI/fastlane/CircleCI ○ GameCI makes it easy to activate Unity licenses, and build for iOS/Android platform ○ Fastlane makes it easy to set up code signing (fastlane match), and distribution(Firebase, App Store, Play Store) ○ CircleCI provides maintenance-free and on-demand build machines required for mobile game CI/CD, including Mac

Slide 34

Slide 34 text

34 Thank you!!