解决Unity未在Travis CI中构建的问题



我已经用我的GitHub repo设置了Travis CI,它保存了我的Unity项目,目前它自动尝试构建我的项目,但迄今为止还没有成功一次。经过大量的摆弄、研究和故障排除,Travis现在已经成功下载并安装了所需的文件(耶!进度),但它在构建过程中陷入了困境。这是输出

Attempting to build GodGame for Windows
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated

我的.travis.yml有

language: objective-c
osx_image: xcode8.1
rvm:
- 2.2
before_install:
- chmod a+x ./Script/install.sh
- chmod a+x ./Script/build.sh
install:
- ./Script/install.sh
script:
- ./Script/build.sh

我的install.sh有

#!/bin/sh
BASE_URL=http://netstorage.unity3d.com/unity
HASH=46dda1414e51
VERSION=2017.2.0f3
download() {
file=$1
url="$BASE_URL/$HASH/$package"
echo "Downloading from $url: "
curl -o `basename "$package"` "$url"
}
install() {
package=$1
download "$package"
echo "Installing "`basename "$package"`
sudo installer -dumplog -package `basename "$package"` -target /
}
# See $BASE_URL/$HASH/unity-$VERSION-$PLATFORM.ini for complete list
# of available packages, where PLATFORM is `osx` or `win`
install "MacEditorInstaller/Unity-$VERSION.pkg"
install "MacEditorTargetInstaller/UnitySetup-Windows-Support-for-Editor-$VERSION.pkg"
install "MacEditorTargetInstaller/UnitySetup-Mac-Support-for-Editor-$VERSION.pkg"
install "MacEditorTargetInstaller/UnitySetup-Linux-Support-for-Editor-$VERSION.pkg"

我的建筑有

#!/bin/sh
project="GodGame"
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

echo 'Attempting to zip builds'
zip -r $(pwd)/Build/linux.zip $(pwd)/Build/linux/
zip -r $(pwd)/Build/mac.zip $(pwd)/Build/osx/
zip -r $(pwd)/Build/windows.zip $(pwd)/Build/windows/

如果有帮助的话,这是我的.gitignore。这里可能有一行我需要删除吗?

###
# Unity folders and files
###
[Aa]ssets/AssetStoreTools*
[Bb]uild/
[Ll]ibrary/
[Ll]ocal[Cc]ache/
[Oo]bj/
[Tt]emp/
[Uu]nityGenerated/
# file on crash reports
sysinfo.txt
# Unity3D generated meta files
*.pidb.meta
###
# VS/MD solution and project files
###
[Ee]xportedObj/
*.booproj
*.csproj
*.sln
*.suo
*.svd
*.unityproj
*.user
*.userprefs
*.pidb
.DS_Store
###
# OS generated
###
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db

请注意,当我直接从Unity尝试时,它确实建立在我的本地机器上。提前感谢任何能提供帮助的人。请记住,我以前从未使用过CI,所以这也是我在努力学习的。我也对其他CI解决方案的任何建议持开放态度。一些免费的东西,最好是不需要我的项目是开源的(私有回购),(最好)基于云的。

您的构建命令中缺少。为单独的行添加它,因为现在它没有得到标志。例如:

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

最新更新