Important
The action is no longer be maintained and has been moved to buildalon/unity-action
An atomic GitHub Action that runs cli tool for passing commands to the Unity Engine.
Part of the Mixed Reality Toolkit (XRTK) open source project.
This action does not require the use of XRTK in your Unity project.
- xrtk/unity-setup Downloads and installs the unity editor.
- xrtk/unity-action An cli tool for passing commands to the Unity Engine.
- xrtk/unity-build (Requires XRTK plugin in Unity Project)
Input | Description | Required | Default |
---|---|---|---|
build-target |
Platform build target. | false |
'' |
args |
Unity command line arguments. | false |
'-quit -batchmode -nographics' |
log-name |
Name of the Unity Log. | false |
'Unity' |
A unity-process-id.txt
file containing the ID of the Unity process running during the Unity Action execution is created in the workspace directory. This output is useful if you need to kill the Unity process after the action execution. You can retrieve the process ID by reading the contents of the unity-process-id.txt
file.
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
#max-parallel: 2 # Use this if you're activating pro license with matrix
matrix:
include:
- os: ubuntu-latest
build-target: StandaloneLinux64
- os: windows-latest
build-target: StandaloneWindows64
- os: macos-latest
build-target: StandaloneOSX
steps:
- name: checkout self
uses: actions/checkout@v3
# Installs the Unity Editor based on your project version text file
# sets -> env.UNITY_EDITOR_PATH
# sets -> env.UNITY_PROJECT_PATH
# https://github.com/XRTK/unity-setup
- uses: xrtk/[email protected]
with:
build-targets: ${{ matrix.build-target }}
# Activates the installation with the provided credentials
- uses: xrtk/[email protected]
with:
# Required
username: ${{ secrets.UNITY_USERNAME }}
password: ${{ secrets.UNITY_PASSWORD }}
# Optional
license-type: 'Personal' # Chooses license type to use [ Personal, Professional ]
serial: ${{ secrets.UNITY_SERIAL }} # Required for pro/plus activations
- uses: xrtk/[email protected]
name: '${{ matrix.build-target }}-Tests'
with:
build-target: '${{ matrix.build-target }}'
args: '-batchmode -runEditorTests'
log-name: '${{ matrix.build-target }}-Tests'
- uses: xrtk/[email protected]
name: '${{ matrix.build-target }}-Build'
with:
build-target: '${{ matrix.build-target }}'
args: '-quit -batchmode -executeMethod XRTK.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild'
log-name: '${{ matrix.build-target }}-Build'