1+ version : 2.1
2+ executors :
3+ unity :
4+ # https://hub.docker.com/r/gableroux/unity3d/tags
5+ parameters :
6+ version : {type: string}
7+ docker :
8+ - image : gableroux/unity3d:<< parameters.version >>
9+ commands :
10+ unity_activate :
11+ parameters :
12+ unity_version : {type: string}
13+ unity_license : {type: string}
14+ steps :
15+ # get activation file, if fail to activate unity, use this key and activate from https://license.unity3d.com/manual
16+ - run : apt update && apt install libunwind8 -y
17+ - run : /opt/Unity/Editor/Unity -quit -batchmode -nographics -logFile -createManualActivationFile || exit 0
18+ - run : cat Unity_v<< parameters.unity_version >>.alf
19+ # get from UNITY_LICENSE envvar(base64 encoded(cat foo.ulf | base64 )), this file is generated from above manual activation
20+ - run : echo << parameters.unity_license >> | base64 -di >> .circleci/Unity.ulf
21+ - run : /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -manualLicenseFile .circleci/Unity.ulf || exit 0
22+ jobs :
23+ build-and-test :
24+ parameters :
25+ unity_version : {type: string}
26+ unity_license : {type: string}
27+ executor :
28+ name : unity
29+ version : << parameters.unity_version >>
30+ steps :
31+ - checkout
32+ - unity_activate :
33+ unity_version : << parameters.unity_version >>
34+ unity_license : << parameters.unity_license >>
35+ - run :
36+ name : Build Linux(Mono)
37+ command : /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod UnitTestBuilder.BuildUnitTest /headless /ScriptBackend Mono2x /BuildTarget StandaloneLinux64
38+ working_directory : .
39+ - run : ./bin/UnitTest/StandaloneLinux64_Mono2x/test
40+ build-and-create-package :
41+ parameters :
42+ unity_version : {type: string}
43+ unity_license : {type: string}
44+ executor :
45+ name : unity
46+ version : << parameters.unity_version >>
47+ steps :
48+ - checkout
49+ - unity_activate :
50+ unity_version : << parameters.unity_version >>
51+ unity_license : << parameters.unity_license >>
52+ - run :
53+ name : Export unitypackage
54+ command : /opt/Unity/Editor/Unity -quit -batchmode -nographics -silent-crashes -logFile -projectPath . -executeMethod PackageExporter.Export
55+ working_directory : .
56+ - store_artifacts :
57+ path : ./UniRx.unitypackage
58+ destination : /UniRx.unitypackage
59+ workflows :
60+ version : 2
61+ build-unity :
62+ jobs :
63+ # - build-and-test:
64+ # unity_version: 2019.1.2f1
65+ # unity_license: ${UNITY_LICENSE_2019_1}
66+ - create-package :
67+ unity_version : 2019.1.2f1
68+ unity_license : ${UNITY_LICENSE_2019_1}
0 commit comments