Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
/ unity-action Public archive

A basic Unity action for XRTK GitHub action workflows

License

Notifications You must be signed in to change notification settings

XRTK/unity-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity Action (XRTK)

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.

Related Github Actions

How to use

Inputs

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'

Outputs

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.

Example

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'