Dev/update for site docs #59
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [2019.x, 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: buildalon/unity-setup@v1 | |
with: | |
unity-version: ${{ matrix.unity-version }} | |
build-targets: ${{ matrix.build-target }} | |
# Activates the installation with the provided credentials | |
- uses: buildalon/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 | |
- uses: buildalon/unity-action@v1 | |
name: Project Validation | |
with: | |
log-name: 'project-validation' | |
args: '-quit -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset' | |
- uses: buildalon/unity-action@v1 | |
name: '${{ matrix.build-target }}-Build' | |
with: | |
log-name: '${{ matrix.build-target }}-Build' | |
build-target: '${{ matrix.build-target }}' | |
args: '-quit -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild -export' | |
- uses: actions/upload-artifact@v4 | |
id: upload-artifact | |
name: 'Upload ${{ matrix.build-target }} Artifacts' | |
if: success() || failure() | |
with: | |
compression-level: 0 | |
retention-days: 1 | |
name: '${{ github.run_number }}.${{ github.run_attempt }}-${{ matrix.os }} ${{ matrix.unity-version }} ${{ matrix.build-target }}-Artifacts' | |
path: | | |
${{ github.workspace }}/**/*.log | |
${{ env.UNITY_PROJECT_PATH || github.workspace }}/Builds/${{ matrix.build-target }}/**/* | |
!${{ env.UNITY_PROJECT_PATH || github.workspace }}/Library/**/* | |
!/**/*_BackUpThisFolder_ButDontShipItWithYourGame/** | |
!/**/*_BurstDebugInformation_DoNotShip/** | |
- 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 |