update
This commit is contained in:
@@ -8,6 +8,9 @@ outputs:
|
|||||||
buildTarget:
|
buildTarget:
|
||||||
description: "Unity Build Target."
|
description: "Unity Build Target."
|
||||||
value: ${{ steps.getTarget.outputs.buildTarget }}
|
value: ${{ steps.getTarget.outputs.buildTarget }}
|
||||||
|
buildArg:
|
||||||
|
description: "Unity Build Argument."
|
||||||
|
value: ${{ steps.getTarget.outputs.buildArg }}
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
@@ -15,20 +18,6 @@ runs:
|
|||||||
id: getTarget
|
id: getTarget
|
||||||
run: |
|
run: |
|
||||||
#Choose the correct buildTarget: https://docs.unity3d.com/Manual/EditorCommandLineArguments.html
|
#Choose the correct buildTarget: https://docs.unity3d.com/Manual/EditorCommandLineArguments.html
|
||||||
UNITY_PLATFORM=${{ inputs.platform }}
|
|
||||||
UNITY_TARGET=$UNITY_PLATFORM
|
bash ${{ github.action_path }}/get_target.sh "${{ inputs.platform }}"
|
||||||
|
|
||||||
if [[ $UNITY_PLATFORM == "windows" ]]; then
|
|
||||||
UNITY_TARGET=Win64
|
|
||||||
elif [[ $UNITY_PLATFORM == "windows32bit" ]]; then
|
|
||||||
UNITY_TARGET=Win
|
|
||||||
elif [[ $UNITY_PLATFORM == "mac" ]]; then
|
|
||||||
UNITY_TARGET=OSXUniversal
|
|
||||||
elif [[ $UNITY_PLATFORM == "linux" ]]; then
|
|
||||||
UNITY_TARGET=Linux64
|
|
||||||
elif [[ $UNITY_PLATFORM == "android" ]]; then
|
|
||||||
UNITY_TARGET=Android
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "::set-output name=buildTarget::$UNITY_TARGET"
|
|
||||||
shell: bash
|
shell: bash
|
||||||
38
unity-get-buildtarget/get_target.sh
Normal file
38
unity-get-buildtarget/get_target.sh
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
UNITY_TARGET="$1"
|
||||||
|
|
||||||
|
TARGET=$(echo "$UNITY_TARGET" | awk '{print tolower($0)}')
|
||||||
|
BUILD_ARG=""
|
||||||
|
case $TARGET in
|
||||||
|
"windows")
|
||||||
|
UNITY_TARGET=Win64
|
||||||
|
BUILD_ARG=-buildWindows64Player
|
||||||
|
;;
|
||||||
|
"windows32bit")
|
||||||
|
UNITY_TARGET=Win
|
||||||
|
BUILD_ARG=-buildWindowsPlayer
|
||||||
|
;;
|
||||||
|
"mac")
|
||||||
|
UNITY_TARGET=OSXUniversal
|
||||||
|
BUILD_ARG=-buildOSXUniversalPlayer
|
||||||
|
;;
|
||||||
|
"ios")
|
||||||
|
UNITY_TARGET=iOS
|
||||||
|
;;
|
||||||
|
"linux")
|
||||||
|
UNITY_TARGET=Linux64
|
||||||
|
BUILD_ARG=-buildLinux64Player
|
||||||
|
;;
|
||||||
|
"android")
|
||||||
|
UNITY_TARGET=Android
|
||||||
|
;;
|
||||||
|
"webgl")
|
||||||
|
UNITY_TARGET=WebGL
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid target. Valid options are: Windows, Windows32bit, Mac, iOS, Linux, Android, WebGL"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "::set-output name=buildTarget::$UNITY_TARGET"
|
||||||
|
echo "::set-output name=buildArg::$BUILD_ARG"
|
||||||
@@ -18,21 +18,6 @@ runs:
|
|||||||
id: getContainer
|
id: getContainer
|
||||||
run: |
|
run: |
|
||||||
#Choose the appropriate container from: https://hub.docker.com/r/unityci/editor
|
#Choose the appropriate container from: https://hub.docker.com/r/unityci/editor
|
||||||
UNITY_VERSION=${{ inputs.version }}
|
|
||||||
UNITY_PLATFORM=${{ inputs.platform }}
|
bash ${{ github.action_path }}/get_target.sh "${{ inputs.platform }}" "${{ inputs.version }}"
|
||||||
|
|
||||||
if [[ $UNITY_PLATFORM == "windows" || $UNITY_PLATFORM == "windows32bit" ]]; then
|
|
||||||
UNITY_PLATFORM=windows-mono-1.0.1
|
|
||||||
elif [[ $UNITY_PLATFORM == "mac" ]]; then
|
|
||||||
UNITY_PLATFORM=mac-mono-1.0.1
|
|
||||||
elif [[ $UNITY_PLATFORM == "linux" ]]; then
|
|
||||||
UNITY_PLATFORM=base-1.0.1
|
|
||||||
UNITY_VERSION=ubuntu-$UNITY_VERSION
|
|
||||||
elif [[ $UNITY_PLATFORM == "android" ]]; then
|
|
||||||
UNITY_PLATFORM=$UNITY_PLATFORM-1.0.1
|
|
||||||
fi
|
|
||||||
|
|
||||||
CONTAINER=unityci/editor:$UNITY_VERSION-$UNITY_PLATFORM
|
|
||||||
|
|
||||||
echo "::set-output name=container::$CONTAINER"
|
|
||||||
shell: bash
|
shell: bash
|
||||||
36
unity-get-container/get_container.sh
Normal file
36
unity-get-container/get_container.sh
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Choose the appropriate container from: https://hub.docker.com/r/unityci/editor
|
||||||
|
UNITY_TARGET="$1"
|
||||||
|
UNITY_VERSION="$2"
|
||||||
|
|
||||||
|
TARGET=$(echo "$UNITY_TARGET" | awk '{print tolower($0)}')
|
||||||
|
BUILD_ARG=""
|
||||||
|
case $TARGET in
|
||||||
|
"windows" | "windows32bit")
|
||||||
|
UNITY_TARGET=windows-mono-1.0.1
|
||||||
|
;;
|
||||||
|
"mac")
|
||||||
|
UNITY_TARGET=mac-mono-1.0.1
|
||||||
|
;;
|
||||||
|
"ios")
|
||||||
|
UNITY_TARGET=ios-1.0.1
|
||||||
|
UNITY_VERSION=ubuntu-$UNITY_VERSION
|
||||||
|
;;
|
||||||
|
"linux")
|
||||||
|
UNITY_TARGET=base-1.0.1
|
||||||
|
UNITY_VERSION=ubuntu-$UNITY_VERSION
|
||||||
|
;;
|
||||||
|
"android")
|
||||||
|
UNITY_TARGET=$TARGET-1.0.1
|
||||||
|
;;
|
||||||
|
"webgl")
|
||||||
|
UNITY_TARGET=webgl-1.0.1
|
||||||
|
UNITY_VERSION=ubuntu-$UNITY_VERSION
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid target. Valid options are: Windows, Windows32bit, Mac, iOS, Linux, Android, WebGL"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
CONTAINER=unityci/editor:$UNITY_VERSION-$UNITY_TARGET
|
||||||
|
echo "::set-output name=container::$CONTAINER"
|
||||||
Reference in New Issue
Block a user