Skip to content

unity-build-validation #341

unity-build-validation

unity-build-validation #341

Workflow file for this run

name: unity-build-validation
on:
schedule:
- cron: '0 0 * * 0' # Every Sunday at midnight
push:
branches:
- 'main'
pull_request:
branches:
- '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ ( github.event_name == 'pull_request' || github.event.action == 'synchronize' ) }}
jobs:
build:
env:
UNITY_PROJECT_PATH: ''
runs-on: ${{ matrix.os }}
name: build (${{ matrix.os }}, ${{ matrix.unity-version }}, ${{ matrix.build-target }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-15]
unity-version: [2020.x, 2021.x, 2022.x, 6000.x]
build-target: [Android]
include: # for each os specify the build targets
- os: ubuntu-latest
unity-version: 6000.x
build-target: StandaloneLinux64
- os: windows-latest
unity-version: 6000.x
build-target: StandaloneWindows64
- os: windows-latest
unity-version: 6000.x
build-target: WSAPlayer
- os: macos-15
unity-version: 6000.x
build-target: iOS
- os: macos-15
unity-version: 6000.x
build-target: StandaloneOSX
steps:
- uses: actions/checkout@v4
with:
clean: true
# Installs the Unity Editor based on your project version text file
# sets -> env.UNITY_EDITOR_PATH
# sets -> env.UNITY_PROJECT_PATH
- uses: RageAgainstThePixel/unity-setup@v1
with:
unity-version: ${{ matrix.unity-version }}
build-targets: ${{ matrix.build-target }}
# Activates the installation with the provided credentials
- uses: RageAgainstThePixel/activate-unity-license@v1
with:
license: 'Personal' # Choose license type to use [ Personal, Professional ]
username: ${{ secrets.UNITY_USERNAME }}
password: ${{ secrets.UNITY_PASSWORD }}
# serial: ${{ secrets.UNITY_SERIAL }} # Required for pro activations
- name: Unity Build (${{ matrix.build-target }})
uses: RageAgainstThePixel/unity-build@main
with:
build-target: ${{ matrix.build-target }}
output-directory: ${{ github.workspace }}/Artifacts/${{ matrix.build-target }}
additional-validation-args: -importTMProEssentialsAsset
additional-build-args: -export
publish-artifacts: true
artifact-name: '${{ github.run_number }}.${{ github.run_attempt }}-${{ matrix.os }}-${{ matrix.unity-version }}-${{ matrix.build-target }}-Artifacts'
test: false
- name: Validate Text Mesh Pro Resources
if: ${{ matrix.unity-version != '6000.x' }}
run: |
# Validate Text Mesh Pro Resources
$TMPRO_PATH = "$env:UNITY_PROJECT_PATH/Assets/TextMesh Pro"
if (Test-Path $TMPRO_PATH) {
Write-Host "Text Mesh Pro Resources found at $TMPRO_PATH"
} else {
Write-Host "Text Mesh Pro Resources not found at $TMPRO_PATH"
# list the folders in the Assets directory
Get-ChildItem -Path $env:UNITY_PROJECT_PATH/Assets -Directory | Select-Object Name | Format-Table -AutoSize
exit 1
}
shell: pwsh