CI/CD for your Unity Projects

Working more efficiently as a Game Developer

center

By Joshua Macauley (@Macawls)

View the presentation in your browser at macawls.dev/unitydeployexample

A little bit about me

center

  • I've always enjoyed messing with things!
  • Linux and Open-Source ❤️
  • DRY -> Don't repeat yourself!
  • RTFM -> Read the fucking manual

Source Control is Important!

Use source control when making a game in a team.

Git is the most popular.

Other good options for Unity include:

Lets outline the problem

You're working with a team of four during the Game Jam.

Bob wants to playtest Timmy's changes.

Adam, the artist who doesn't know how to use Github wants to test the game.

The problem continued

There's a hour left, everyone is exhausted.

You have to manually fetch the latest change and build the project.

Suddenly there's a problem with the build without much time to fix it.

The Solution! What is CI/CD?

  • CI - Continous Integration
  • CD - Continous Deployment

Definiton

"CI/CD is a method to frequently deliver apps to customers by introducing automation into the stages of app development."

Why is it useful?

Deliver improvements and fixes MUCH faster and have the peace of mind your code is build ready and safe for production.

Development and Operations Pipeline

center

What is Github Actions?

"GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline."

center

What can I do with GitHub Actions?

Many things!

  • Automatically test your game to make sure its ready for production.
  • Automatically build your game on the cloud.
  • Automatically publish your game to multiple stores!

Is it all free?

Pretty much!

https://github.com/pricing

The game in the example repository takes around 4 minutes per platform (Windows, Web, Mac) to build and deploy.

With the free 2000 CI/CD minutes limit that equates to a maximum of around 160 builds per month!

What is this wizardry? 🧙‍♂️

- uses: actions/cache@v2
    with:
        path: Library
        key: Library-${{ matrix.targetPlatform }}
        restore-keys: Library- 
- uses: game-ci/unity-builder@v2
    env:
        UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
    with:
        targetPlatform: ${{ matrix.targetPlatform }}

Quick to implement + easy to use = abstraction.

If you're interested in learning more, have a look at Docker, which solves the problem of "It doesn't work on my machine!".

Great! How do I get started?

Easy Peasy!

  • Have a look at this repository and follow the instructions.
  • Customize it to your use case.

https://github.com/Macawls/UnityDeployExample



Discliamer: The contents of this repository is highly simplified.

Hope you enjoyed! ✌️

Good luck for the Game Jam!

center


For any queries contact me at josh@macawls.dev