-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathci-build.sh
executable file
·70 lines (51 loc) · 2.1 KB
/
ci-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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
source ci-setup.sh
echo Downloading AVProVideo
echo "${GPG_PRIVATE_KEY_BASE64}" | base64 -d > private.gpg
gpg --batch --import private.gpg
curl -L 'https://renderer-artifacts.decentraland.org/artifacts/Custom_AVProVideo_2.6.7_ULTRA.unitypackage.gpg' -o Custom_AVProVideo_2.6.7_ULTRA.unitypackage.gpg
gpg --output Custom_AVProVideo_2.6.7_ULTRA.unitypackage --decrypt Custom_AVProVideo_2.6.7_ULTRA.unitypackage.gpg
echo Finished downloading AVProVideo
echo Begin importing AVProVideo
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' $UNITY_PATH/Editor/Unity \
-quit \
-batchmode \
-importPackage $(pwd)/Custom_AVProVideo_2.6.7_ULTRA.unitypackage \
-projectPath "$PROJECT_PATH"
echo Ended importing AvProVideo
echo Begin importing license
if [ -z "$DEVELOPERS_UNITY_LICENSE_CONTENT_2020_3_BASE64" ]; then
echo 'DEVELOPERS_UNITY_LICENSE_CONTENT_2020_3_BASE64 not present. License won''t be configured'
else
LICENSE=$(echo "${DEVELOPERS_UNITY_LICENSE_CONTENT_2020_3_BASE64}" | base64 -di | tr -d '\r')
echo "Writing LICENSE to license file /root/.local/share/unity3d/Unity/Unity_lic.ulf"
echo "$LICENSE" > /root/.local/share/unity3d/Unity/Unity_lic.ulf
fi
echo End importing license
echo "Building for $BUILD_TARGET at $PROJECT_PATH"
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' $UNITY_PATH/Editor/Unity \
-quit \
-batchmode \
-projectPath "$PROJECT_PATH" \
-logFile "$BUILD_PATH/build-logs.txt" \
-buildTarget "$BUILD_TARGET" \
-customBuildTarget "$BUILD_TARGET" \
-customBuildName "$BUILD_NAME" \
-customBuildPath "$BUILD_PATH" \
-executeMethod BuildCommand.PerformBuild
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"
if [ -z "$(ls -A "$BUILD_PATH")" ]; then
echo "directory BUILD_PATH $BUILD_PATH is empty"
UNITY_EXIT_CODE=4
fi
exit $UNITY_EXIT_CODE;