如何在Travis Ci中使用Unity项目?

时间:2018-09-28 09:55:20

标签: unity3d sh travis-ci pipeline

我正在遵循本指南:

https://jonathan.porta.codes/2015/04/17/automatically-build-your-unity3d-project-in-the-cloud-using-travisci-for-free/

我想做的是与Travic Ci一起测试一个统一项目。我一直在努力使它工作。 Maybi某人对它的工作原理有所了解,但效果不是很好。我不知道如何解决这个问题。我一直卡在同一错误中,例如:

$ ./scripts/install.sh
Downloading from http://netstorage.unity3d.com/unity/3757309da7e7/MacEditorInstaller/Unity-5.2.2f1.pkg: 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    16  100    16    0     0    774      0 --:--:-- --:--:-- --:--:--   761
Installing Unity.pkg
installer: Error the package path specified was invalid: 'Unity.pkg'.
install: editor,: No such file or directory
install: windowssupport,: No such file or directory
install: linuxsupport,: No such file or directory
The command "./scripts/install.sh" failed and exited with 71 during .
Your build has been stopped.

这是我的脚本文件install.sh:

#! /bin/sh

# Example install script for Unity3D project. See the entire example: https://github.com/JonathanPorta/ci-build

# This link changes from time to time. I haven't found a reliable hosted installer package for doing regular
# installs like this. You will probably need to grab a current link from: http://unity3d.com/get-unity/download/archive
echo 'Downloading from http://netstorage.unity3d.com/unity/3757309da7e7/MacEditorInstaller/Unity-5.2.2f1.pkg: '
curl -o Unity.pkg http://netstorage.unity3d.com/unity/3757309da7e7/MacEditorInstaller/Unity-5.2.2f1.pkg

echo 'Installing Unity.pkg'
sudo installer -dumplog -package Unity.pkg -target /

这是我的build.sh文件:

#! /bin/sh

# Example build script for Unity3D project. See the entire example: https://github.com/JonathanPorta/ci-build

# Change this the name of your project. This will be the name of the final executables as well.
project="ci-build"

echo "Attempting to build $project for Windows"
/Applications/Unity/Unity.app/Contents/MacOS/Unity \
  -batchmode \
  -nographics \
  -silent-crashes \
  -logFile $(pwd)/unity.log \
  -projectPath $(pwd) \
  -buildWindowsPlayer "$(pwd)/Build/windows/$project.exe" \
  -quit

echo "Attempting to build $project for OS X"
/Applications/Unity/Unity.app/Contents/MacOS/Unity \
  -batchmode \
  -nographics \
  -silent-crashes \
  -logFile $(pwd)/unity.log \
  -projectPath $(pwd) \
  -buildOSXUniversalPlayer "$(pwd)/Build/osx/$project.app" \
  -quit

echo "Attempting to build $project for Linux"
/Applications/Unity/Unity.app/Contents/MacOS/Unity \
  -batchmode \
  -nographics \
  -silent-crashes \
  -logFile $(pwd)/unity.log \
  -projectPath $(pwd) \
  -buildLinuxUniversalPlayer "$(pwd)/Build/linux/$project.exe" \
  -quit

echo 'Logs from build'
cat $(pwd)/unity.log

我希望有人能帮助我解决这个问题!?。谢谢。

1 个答案:

答案 0 :(得分:0)

看看日志:

awaiting

似乎问题出在UnityInstaller。 您正在脚本中尝试下载Installing Unity.pkg installer: Error the package path specified was invalid: 'Unity.pkg'. install: editor,: No such file or directory 。 如果您转到该地址,则会看到该URL上不存在所请求的文件。

Unity-5.2.2f1.pkg

那是您必须解决的第一个问题。

现在,Unity 5.2是一个相当老的版本,该教程是在 2015年4月17日编写的,我想以一个较新的版本来补充该教程。