Include default-build-script in docker

This commit is contained in:
Webber 2019-12-07 23:52:05 +01:00 committed by Webber Takken
parent 35e88ac302
commit c8b1b80829
3 changed files with 20 additions and 7 deletions

View File

@ -4,3 +4,4 @@
# Files required for the action
!entrypoint.sh
!action.yml
!default-build-script

View File

@ -9,6 +9,7 @@ LABEL "repository"="http://github.com/webbertakken/unity-actions"
LABEL "homepage"="http://github.com/webbertakken/unity-actions"
LABEL "maintainer"="Webber Takken <webber@takken.io>"
ADD default-build-script /UnityBuilderAction
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

View File

@ -47,21 +47,32 @@ CURRENT_BUILD_PATH=$BUILDS_PATH/$BUILD_TARGET
CURRENT_BUILD_FULL_PATH=$BUILDS_FULL_PATH/$BUILD_TARGET
#
# Set the build command, must reference one of:
# Set the build method, must reference one of:
#
# - <NamespaceName.ClassName.MethodName>
# - <ClassName.MethodName>
#
# For example: `BuildCommand.PerformBuild`
#
# The method must be defined static
# The method must be declared static and placed in project/Assets/Editor
#
if [ -z "$BUILD_COMMAND" ]; then
# TODO - copy Builder class from root
EXECUTE_METHOD="-executeMethod Builder.BuildProject"
if [ -n "$BUILD_METHOD" ]; then
# User has provided their own build method.
#
# Assume they also bring their own script; simply reference it.
#
EXECUTE_BUILD_METHOD="-executeMethod $BUILD_METHOD"
#
else
EXECUTE_METHOD="-executeMethod $BUILD_COMMAND"
# User has not provided their own build command.
#
# Use the script from this action which builds the scenes that are enabled in
# the project.
#
cp -r /UnityBuilderAction $CURRENT_BUILD_PATH/Assets/Editor/
EXECUTE_BUILD_METHOD="-executeMethod UnityBuilderAction.Builder.BuildProject"
#
fi
@ -116,7 +127,7 @@ xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
-buildTarget "$BUILD_TARGET" \
-customBuildTarget "$BUILD_TARGET" \
-customBuildPath "$CURRENT_BUILD_FULL_PATH" \
$EXECUTE_METHOD
$EXECUTE_BUILD_METHOD
# Catch exit code
BUILD_EXIT_CODE=$?