#!/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=""
REVISION="3"
case $TARGET in
    "windows" | "windows32bit" | "windowsarm")
        UNITY_TARGET=windows-mono-$REVISION
        ;;
    "mac" | "osx")
        UNITY_TARGET=mac-mono-$REVISION
        ;;
    "ios")
        UNITY_TARGET=ios-$REVISION
        UNITY_VERSION=ubuntu-$UNITY_VERSION
        ;;
    "linux")
        UNITY_TARGET=base-$REVISION
        UNITY_VERSION=ubuntu-$UNITY_VERSION
        ;;
    "android")
        UNITY_TARGET=android-$REVISION
        UNITY_VERSION=ubuntu-$UNITY_VERSION
        ;;
    "webgl")
        UNITY_TARGET=webgl-$REVISION
        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 "container=$CONTAINER" >> "$GITHUB_OUTPUT"