Updated with UnityBuilder and cache.

This commit is contained in:
2023-03-19 02:35:02 -07:00
parent c1dc2ddc9b
commit 1a40a9a050
5 changed files with 27 additions and 23 deletions

View File

@@ -2,12 +2,12 @@
ARG IMAGE=unityci/base:latest ARG IMAGE=unityci/base:latest
FROM ${IMAGE} FROM ${IMAGE}
RUN apt update
RUN apt install -y wget chromium-browser
COPY entrypoint.sh / COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh
COPY install-dotnet.sh /
RUN bash /install-dotnet.sh
ADD https://minio.studiowhy.net/hackmd/UnityBuilder /usr/local/bin/ ADD https://minio.studiowhy.net/hackmd/UnityBuilder /usr/local/bin/
RUN chmod +x /usr/local/bin/UnityBuilder RUN chmod +x /usr/local/bin/UnityBuilder

View File

@@ -24,6 +24,9 @@ inputs:
command: command:
description: "Unity command to run." description: "Unity command to run."
required: false required: false
unityBuilder:
description: "Whether or not to use the UnityBuilder instead of a Unity command."
required: false
runs: runs:
using: "composite" using: "composite"
steps: steps:
@@ -46,6 +49,7 @@ runs:
email: ${{ inputs.email }} email: ${{ inputs.email }}
password: ${{ inputs.password }} password: ${{ inputs.password }}
command: ${{ inputs.command }} command: ${{ inputs.command }}
unityBuilder: ${{ inputs.unityBuilder }}
- name: "Remove temporary image." - name: "Remove temporary image."
run: | run: |
docker image rm ${{ inputs.imageTag }} docker image rm ${{ inputs.imageTag }}

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
SERIAL=$1; EMAIL=$2; PASSWORD=$3; COMMAND=$4 SERIAL=$1; EMAIL=$2; PASSWORD=$3; COMMAND=$4; UNITY_BUILDER=$4
DEFAULT_ARGS="-quit -logFile -" DEFAULT_ARGS="-quit -logFile -"
rm -rf $HOME/.config/unity3d rm -rf $HOME/.config/unity3d
@@ -32,5 +32,9 @@ else
fi fi
#Run the command. #Run the command.
if [[ -n "$UNITY_BUILDER" ]]; then
UnityBuilder $COMMAND
else
unity-editor $DEFAULT_ARGS $COMMAND unity-editor $DEFAULT_ARGS $COMMAND
fi
ls -Al Library ls -Al Library

View File

@@ -1,13 +0,0 @@
#!/bin/bash
apt update
apt install wget -y
#wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
#dpkg -i packages-microsoft-prod.deb
#rm packages-microsoft-prod.deb
#
#apt update
#apt install -y dotnet-sdk-6.0
#For UnityBuilder
apt install -y chromium-browser

View File

@@ -21,6 +21,12 @@ inputs:
command: command:
description: "Unity command to run." description: "Unity command to run."
required: false required: false
unityBuilder:
description: "Whether or not to use the UnityBuilder instead of a Unity command."
required: false
cacheVolume:
description: "Name of the volume to cache the Library folder to."
required: false
runs: runs:
using: "composite" using: "composite"
steps: steps:
@@ -34,10 +40,11 @@ runs:
uses: act/unity/unity-get-buildtarget@master uses: act/unity/unity-get-buildtarget@master
with: with:
platform: ${{ inputs.platform }} platform: ${{ inputs.platform }}
- name: "Library" - name: "Restore the cached Library folder."
if: ${{ inputs.cacheVolume }}
uses: act/common/docker/docker-cp@master uses: act/common/docker/docker-cp@master
with: with:
volume: library volume: ${{ inputs.cacheVolume }}
toPath: . toPath: .
- name: "Run Unity command." - name: "Run Unity command."
uses: act/unity/unity-command@master uses: act/unity/unity-command@master
@@ -48,8 +55,10 @@ runs:
email: ${{ inputs.email }} email: ${{ inputs.email }}
password: ${{ inputs.password }} password: ${{ inputs.password }}
command: -projectPath ${{ inputs.projectPath }} -buildTarget ${{ steps.getTarget.outputs.buildTarget }} ${{ inputs.command }} command: -projectPath ${{ inputs.projectPath }} -buildTarget ${{ steps.getTarget.outputs.buildTarget }} ${{ inputs.command }}
- uses: act/common/docker/docker-cp@master - name: "Cache the Library folder."
if: ${{ inputs.cacheVolume }}
uses: act/common/docker/docker-cp@master
with: with:
#recreateVolume: true recreateVolume: true
volume: library volume: ${{ inputs.cacheVolume }}
fromPath: Library fromPath: Library