name: unity-command description: "Run a Unity command using a specified version of Unity." inputs: platform: description: "Unity Platform. Options: windows, windows32bit, mac, linux, android" required: true version: description: "Unity Version." required: true imageTag: description: "Tag to use for the temporary version of Unity. Must refer to an existing public Docker image. Must be the same is in the Dockerfile of the called action." required: true default: unityci/base:latest serial: description: "Unity license serial number. Or 'public' for a public license." required: true default: public email: description: "Unity email." required: true password: description: "Unity password." required: true command: description: "Unity command to run." required: false noGraphics: description: "Whether or not to use the graphics device when running Unity." required: false default: "true" unityBuilder: description: "Whether or not to use the UnityBuilder instead of a Unity command." required: false removeContainer: description: "Remove the mock container after building." required: false default: "true" runs: using: "composite" steps: - name: "Get Unity container name." id: getContainer uses: act/unity/unity-get-container@master with: version: ${{ inputs.version }} platform: ${{ inputs.platform }} - name: "Pull Unity container." run: | CONTAINER="${{ steps.getContainer.outputs.container }}" CACHED_CONTAINER="$CONTAINER-activated" # Activate the license on build. # DOCKER_BUILDKIT=1 \ # SERIAL="${{ inputs.serial }}" USERNAME="${{ inputs.email }}" PASSWORD="${{ inputs.password }}" \ # docker build --secret id=SERIAL,env=SERIAL --secret id=USERNAME,env=USERNAME --secret id=PASSWORD,env=PASSWORD \ # -t $CACHED_CONTAINER --build-arg IMAGE=$CONTAINER ${{ github.action_path }} docker build -t $CACHED_CONTAINER --build-arg IMAGE=$CONTAINER ${{ github.action_path }} docker tag $CACHED_CONTAINER ${{ inputs.imageTag }} shell: bash - name: "Get Unity Command" id: command run: | COMMAND="${{ inputs.command }}" if [[ "{{ inputs.noGraphics }}" == "true" ]]; then COMMAND="-nographics $COMMAND" fi echo "command=$COMMAND" - name: "Run Unity command." uses: act/unity/unity@master with: serial: ${{ inputs.serial }} # serial: "activated" email: ${{ inputs.email }} password: ${{ inputs.password }} command: ${{ steps.command.outputs.command }} unityBuilder: ${{ inputs.unityBuilder }} - name: "Remove temporary image." if: ${{ inputs.removeContainer == 'true' }} run: | docker image rm ${{ inputs.imageTag }} shell: bash