Home

Awesome

unity3d-travis-ci

Build Status unity version

A simple example on how to use Travis-CI to build, test, and deploy a Unity Package to a Github Release. The example Unity Package is a scene with a cube bouncing.

It works by using a Mac OS X version of Unity. This version does not require signing in to build a unity package (unlike the Windows and Linux versions). Travis-CI then builds the project as a Windows 64-bit player and runs test cases against the player. See https://docs.unity3d.com/Manual/testing-editortestsrunner.html for executing a test script in a Unity build. Then a Unity package is built and deployed to a GitHub release when all test cases successfully pass.

I recommend reading a more detailed explaination on how to do this through this blog post: https://hackernoon.com/writing-an-open-source-unity-package-877bad3c8913

Configuration

Do configure the .travis.yml file to your needs:

Picking a Unity Version

To choose a different Unity version to compile with, first visit the Unity Download Archive and get the download URL for the following:

Then go to travis-build\install_unity.sh and add these URLs to the respective enviroment variables: UNITY_OSX_PACKAGE_URL and UNITY_WINDOWS_TARGET_PACKAGE_URL

Other notes

It is possible to upgrade the version of Unity used in Travis-CI. See install_unity.sh. Not all Unity versions may be supported.