When you develop a game with Unity3D and you want to take advantage of the Microsoft ecosystem like Visual Studio Online, it can be hard to configure your CI/CD environment. This blog post will explain how to set up that from pushing code to deploy the game on device automatically.
- Part 1 : Build with Unity CLI
- Part 2 : Continuous Integration with Visual Studio Online
- Part 3 : Continuous Delivery with Visual Studio Online
- Part 4 : Deploy with App Center
Continuous Integration with Visual Studio Online
Well, you are a big fan of Visual Studio Online to manage all your projects (me too!) so let’s create a new one, mine is using Git. Once the difficult task of finding the right project name done, click on the setting wheel and select Agent Queues.
You need to set up a machine that will build the project, it can be a virtual machine (like on Azure) or your actual machine (not ideal but works well for a demonstration). We will use the second option to simplify.
The capability will be use later to filter the list of agent in order to select the one that can work with Unity project. It is not mandatory if you have a queue with the same type of agent but a good practice if you work with many different agents.
It’s time to create the build definition, select the Build menu and click on the New button :
Select the pool agent where you have install your agent (mine is Default) :
Add a Batch Script task :
Add a Publish Build Artifacts task :
Don’t forget to enable continuous integration :
… and to select an agent that can handle Unity project :
That’s all. You can save your build definition and queue a new build or push code in your repository. In the next post, we will see how to send the generated apk file to App Center with a release definition.