Files
unity/unity-get-version/action.yaml
2023-03-19 00:30:33 -07:00

26 lines
745 B
YAML

name: unity-get-version
description: "Get the correct Unity version from a provided project."
inputs:
projectPath:
description: "Path to the Unity project."
required: true
default: "."
outputs:
projectVersion:
description: "Unity project version."
value: ${{ steps.getVersion.outputs.projectVersion }}
runs:
using: "composite"
steps:
- name: "Get Unity project version."
id: getVersion
run: |
VERSION_KEY="m_EditorVersion"
VERSION_FILE="ProjectSettings/ProjectVersion.txt"
VERSION_FILE_PATH="${{ inputs.projectPath }}/$VERSION_FILE"
VERSION=$(grep -w $VERSION_KEY $VERSION_FILE_PATH | cut -d ':' -f2 | xargs)
echo "::set-output name=projectVersion::$VERSION"
shell: bash