Unity3D, the popular game development platform, began offering a ton of services a while back, but a lot of independent developers I’ve met haven’t used them. This makes sense, as integrating things like Ads and Analytics probably won’t become relevant in small projects until the second 90%. However, one service that everyone should make use of the moment they create a new project is Cloud Building.
Before Unity offered cloud building, you basically had to do the whole process yourself. You’d set up a Jenkins instance somewhere and set up a pipeline using the Unity3d plugin, run your tests, and then, if you could, deploy a WebGL build to a demo server.
Creating your own cloud build
Now that we have the cloud building service, getting started is pretty easy. First, in your Unity editor, just switch to the Services tab. You can open the tab by Going to the “Window” menu and clicking “Services”, or just hitting Ctrl+0.
Next find the Cloud Build section and turn it on. Unity will guide you through setting up your first build configuration. Here you will select your version control system and provide the URL for the repository.
If you have a private repository, then Unity will generate an SSH key that you’ll need to hand over to your Git server. You’ll then need to pick a target platform. WebGL is a good choice for demo purposes, as you can actually run the results of your build in the browser.
Finally you set up some details about your target. This includes giving your target a name, as you can have multiple cloud builds for the same project. Then you’ll select the branch to build and the version of Unity you want to use. The Unity version will default to whatever your project is configured with, but you can change it if you really want to. The Auto-build option lets you have your build kick off when there is an SCM change – you don’t always need this, but you definitely want it for your main CI build.
At this point, the build will kick off and your work is basically done. At a minimum, you should have a shareable (or not) link to your built game. If you picked WebGL, then you can actually play that game in the browser. Other build types will simply yield a download for the installer.
Unity3D’s Developer Portal
However, there is still a lot more you can do at the developer portal. So while you wait for your build to finish, it’s a good opportunity to see what you can set up.
One of the options available is to set up unit test execution. Unity makes it very easy to write code unit tests, and their cloud services make it easy to execute them. This might take some getting used to if you’re coming from the C# world and are used to using NuGet.
This should provide you with the basic building blocks to getting automated builds for your new Unity project. If you’re already doing this or are ready for the next steps, you can explore the build service API and further enhance your automation.