1+ name : ' Unity Build (XRTK)'
2+ description : ' Runs a Build using the specified build targets'
3+ branding :
4+ icon : ' '
5+ color : ' '
6+
7+ inputs :
8+ build-target :
9+ description : ' The build target to build for.'
10+ # Unity -buildTarget command line args https://docs.unity3d.com/Manual/CommandLineArguments.html
11+ # StandaloneWindows64, WSAPlayer, StandaloneOSX, iOS, StandaloneLinux64, Android, Lumin, WebGL
12+ defaults : ' '
13+
14+ runs :
15+ using : " composite"
16+ steps :
17+ - id : unity-validate
18+ name : Unity Editor Validation
19+ uses : xrtk/unity-validate@main
20+
21+ - uses : xrtk/unity-action@main
22+ name : Project Validation
23+ with :
24+ name : ' project-validation'
25+ editor-path : ' ${{ steps.unity-validate.outputs.editor-path }}'
26+ project-path : ' ${{ steps.unity-validate.outputs.project-path }}'
27+ args : ' -quit -batchmode -executeMethod XRTK.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject'
28+
29+ - uses : xrtk/unity-action@main
30+ name : ' ${{ inputs.build-target }}-Tests'
31+ with :
32+ name : ' ${{ inputs.build-target }}-Tests'
33+ editor-path : ' ${{ steps.unity-validate.outputs.editor-path }}'
34+ project-path : ' ${{ steps.unity-validate.outputs.project-path }}'
35+ build-target : ' ${{ inputs.build-target }}'
36+ args : ' -batchmode -runEditorTests'
37+
38+ - uses : xrtk/unity-action@main
39+ name : ' ${{ inputs.build-target }}-Build'
40+ with :
41+ name : ' ${{ inputs.build-target }}-Build'
42+ editor-path : ' ${{ steps.unity-validate.outputs.editor-path }}'
43+ project-path : ' ${{ steps.unity-validate.outputs.project-path }}'
44+ build-target : ' ${{ inputs.build-target }}'
45+ args : ' -quit -batchmode -executeMethod XRTK.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild'
46+
47+ - name : Zip Artifacts
48+ if : always()
49+ run : |
50+ $artifacts = "${{ steps.unity-validate.outputs.project-path }}/Builds"
51+
52+ if (Test-Path -Path $artifacts) {
53+ Compress-Archive -Path "$artifacts/*" -DestinationPath ${{ github.workspace }}/${{ runner.os }}-${{ inputs.build-target }}-Artifacts.zip -Force
54+ Remove-Item $artifacts -Force -Recurse
55+ }
56+ shell : pwsh
57+
58+ - uses : actions/upload-artifact@v2
59+ name : Upload Artifacts
60+ if : always()
61+ with :
62+ name : ' ${{ runner.os }}-${{ inputs.build-target }}-Artifacts'
63+ path : ' ${{ github.workspace }}/${{ runner.os }}-${{ inputs.build-target }}-Artifacts.zip'
0 commit comments