Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Scalable and cloud-native mobile game CI/CD env...

Scalable and cloud-native mobile game CI/CD environment using Unity

JetBrains GameDev Day 2023
https://lp.jetbrains.com/gamedev-day-2023/

Tadashi Nemoto

October 14, 2023
Tweet

More Decks by Tadashi Nemoto

Other Decks in Programming

Transcript

  1. 1 Scalable and cloud-native mobile game CI/CD environment using Unity

    Tadashi Nemoto CircleCI Senior Solutions Engineer
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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)
  7. 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
  8. 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
  9. 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
  10. 14 Creation Orchestration Operations Collaborate Source Control CircleCI Deliver Build

    • Test • Deliver・Release Run Monitor • Operate SHIP TO PRODUCTION CODE COMMIT
  11. 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
  12. 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)
  13. 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
  14. 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
  15. 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
  16. 31 • Cloud-native mobile game CI/CD environment using Unity ◦

    https://circleci.com/blog/unity-mobile-cicd/ • github.com/tadashi0713/circleci-demo-mobile-unity
  17. 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