UnityCI
Only unity pro can use commandline to build, otherwise will get Failed to activate/update license problem
Setting CI/CD for a Unity Project in GitHub Actions
tested in 2018.4.10f1
- run docker image
docker run -it gableroux/unity3d:X.X.X
- in docker create activation file
./Unity -quit -batchmode -nographics -logFile -createManualActivationFile
参数 | 说明 |
---|---|
quit | 执行完后结束 |
batchmode | 只在commandline 执行 |
nographics | 没有图像输出 |
logFile | 结果输出到console |
createManualActivationFile | 创建 activation file 包含license |
cat Unity_v2018.2.21f1.alf
- copy paste content to local file
- active this version in unity with alf file
- encrypt this file with openssl
aes-256-cbc -e -in "D:\Shared Projects\Unity\UnityCI\Unity_v2017.x.ulf" -out "D:\Shared Projects\Unity\UnityCI\Unity_v2017.x.ulf.enc" -k wTnz@rW7Ru9@^JhEcYSC-P#=fzNX4%d2
- set GitHub settings secret key
- add .github folder in project, put encrypt file in it
- create workflows folder in it
- add yml configuration file in it
- push to github
using another way
copy
BuildScript.cs
in Assets/Scripts/Editor, this script is used to build unity projectcopy ci file .trvais.yml
copy ci folder