Added many, many more actions.
This commit is contained in:
23
unity/unity-get-buildtarget/action.yaml
Normal file
23
unity/unity-get-buildtarget/action.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
name: unity-get-buildtarget
|
||||
description: "Get the correct Unity build target from a provided platform."
|
||||
inputs:
|
||||
platform:
|
||||
description: "Unity Platform. Options: windows, windows32bit, mac, linux, android"
|
||||
required: true
|
||||
outputs:
|
||||
buildTarget:
|
||||
description: "Unity Build Target."
|
||||
value: ${{ steps.getTarget.outputs.buildTarget }}
|
||||
buildArg:
|
||||
description: "Unity Build Argument."
|
||||
value: ${{ steps.getTarget.outputs.buildArg }}
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: "Get Unity Build Target."
|
||||
id: getTarget
|
||||
run: |
|
||||
#Choose the correct buildTarget: https://docs.unity3d.com/Manual/EditorCommandLineArguments.html
|
||||
|
||||
bash ${{ github.action_path }}/get_target.sh "${{ inputs.platform }}"
|
||||
shell: bash
|
||||
38
unity/unity-get-buildtarget/get_target.sh
Normal file
38
unity/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 "buildTarget=$UNITY_TARGET" >> "$GITHUB_OUTPUT"
|
||||
echo "buildArg=$BUILD_ARG" >> "$GITHUB_OUTPUT"
|
||||
Reference in New Issue
Block a user