-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathbuild.sh
executable file
·35 lines (28 loc) · 920 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
set -euo pipefail
echo "Building for $BUILD_TARGET"
export BUILD_PATH=$UNITY_DIR/Builds/$BUILD_TARGET/
mkdir -p $BUILD_PATH
${UNITY_EXECUTABLE:-xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' unity-editor} \
-projectPath $UNITY_DIR \
-quit \
-batchmode \
-nographics \
-buildTarget $BUILD_TARGET \
-customBuildTarget $BUILD_TARGET \
-customBuildName $BUILD_NAME \
-customBuildPath $BUILD_PATH \
-executeMethod BuildCommand.PerformBuild \
-logFile /dev/stdout
UNITY_EXIT_CODE=$?
if [ $UNITY_EXIT_CODE -eq 0 ]; then
echo "Run succeeded, no failures occurred";
elif [ $UNITY_EXIT_CODE -eq 2 ]; then
echo "Run succeeded, some tests failed";
elif [ $UNITY_EXIT_CODE -eq 3 ]; then
echo "Run failure (other failure)";
else
echo "Unexpected exit code $UNITY_EXIT_CODE";
fi
ls -la $BUILD_PATH
[ -n "$(ls -A $BUILD_PATH)" ] # fail job if build folder is empty