@@ -10,64 +10,67 @@ inputs:
10
10
# Unity -buildTarget command line args https://docs.unity3d.com/Manual/CommandLineArguments.html
11
11
# StandaloneWindows64, WSAPlayer, StandaloneOSX, iOS, StandaloneLinux64, Android, Lumin, WebGL
12
12
default : ' '
13
- additional-validate-args :
14
- description : ' Additional args to pass to validate command'
15
- default : ' '
13
+ test :
14
+ description : ' Run editor tests'
15
+ required : false
16
+ default : ' true'
16
17
additional-test-args :
17
18
description : ' Additional args to pass to test command'
19
+ required : false
18
20
default : ' '
19
21
additional-build-args :
20
22
description : ' Additional args to pass to build command'
23
+ required : false
21
24
default : ' '
25
+ publish-artifacts :
26
+ description : ' Should the workflow publish artifacts?'
27
+ required : false
28
+ default : ' true'
22
29
23
30
runs :
24
31
using : " composite"
25
32
steps :
26
- - id : unity-validate
27
- name : Unity Editor Validation
28
- uses : xrtk/unity-validate@v2
29
-
30
- - uses : xrtk/unity-action@v3
33
+ - uses : xrtk/unity-action@v5
31
34
name : Project Validation
32
35
with :
33
- name : ' project-validation'
34
- editor-path : ' ${{ env.editor-path }}'
35
- project-path : ' ${{ env.project-path }}'
36
- args : ' -quit -batchmode -executeMethod XRTK.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject ${{ inputs.additional-validate-args }}'
36
+ log-name : ' project-validation'
37
+ args : ' -quit -nographics -batchmode -executeMethod XRTK.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject'
37
38
38
- - uses : xrtk/unity-action@v3
39
+ - uses : xrtk/unity-action@v5
40
+ if : ${{ inputs.test == 'true' }}
39
41
name : ' ${{ inputs.build-target }}-Tests'
40
42
with :
41
- name : ' ${{ inputs.build-target }}-Tests'
42
- editor-path : ' ${{ env.editor-path }}'
43
- project-path : ' ${{ env.project-path }}'
43
+ log-name : ' ${{ inputs.build-target }}-Tests'
44
44
build-target : ' ${{ inputs.build-target }}'
45
- args : ' -batchmode -runEditorTests ${{ inputs.additional-test-args }}'
45
+ args : ' -nographics - batchmode -runEditorTests ${{ inputs.additional-test-args }}'
46
46
47
- - uses : xrtk/unity-action@v3
47
+ - uses : xrtk/unity-action@v5
48
48
name : ' ${{ inputs.build-target }}-Build'
49
49
with :
50
- name : ' ${{ inputs.build-target }}-Build'
51
- editor-path : ' ${{ env.editor-path }}'
52
- project-path : ' ${{ env.project-path }}'
50
+ log-name : ' ${{ inputs.build-target }}-Build'
53
51
build-target : ' ${{ inputs.build-target }}'
54
- args : ' -quit -batchmode -executeMethod XRTK.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild ${{ inputs.additional-build-args }}'
52
+ args : ' -quit -nographics -batchmode -executeMethod XRTK.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild ${{ inputs.additional-build-args }}'
53
+
54
+ -
uses :
josStorer/[email protected]
55
+ if : ${{ always() && inputs.publish-artifacts == 'true' }}
56
+ id : current-time
57
+ with :
58
+ format : YYYY-MM-DDTHH-mm-ss-sss
59
+
60
+ - uses : actions/upload-artifact@v3
61
+ name : Upload Artifacts
62
+ if : ${{ always() && inputs.publish-artifacts == 'true' }}
63
+ with :
64
+ name : ' ${{ runner.os }}-${{ inputs.build-target }}-Artifacts-${{ steps.current-time.outputs.formattedTime }}'
65
+ path : ' ${{ env.UNITY_PROJECT_PATH }}/Builds'
55
66
56
- - name : Zip Artifacts
57
- if : always()
67
+ - name : Clean Artifacts
68
+ if : ${{ always() && inputs.publish-artifacts == 'true' }}
58
69
run : |
59
- # Zip Artifacts
60
- $artifacts = "${{ env.project-path }}/Builds"
70
+ # Clean Artifacts
71
+ $artifacts = "${{ env.UNITY_PROJECT_PATH }}/Builds"
61
72
62
73
if (Test-Path -Path $artifacts) {
63
- Compress-Archive -Path "$artifacts/*" -DestinationPath ${{ github.workspace }}/${{ runner.os }}-${{ inputs.build-target }}-Artifacts.zip -Force
64
74
Remove-Item $artifacts -Force -Recurse
65
75
}
66
76
shell : pwsh
67
-
68
- - uses : actions/upload-artifact@v3
69
- name : Upload Artifacts
70
- if : always()
71
- with :
72
- name : ' ${{ runner.os }}-${{ inputs.build-target }}-Artifacts'
73
- path : ' ${{ github.workspace }}/${{ runner.os }}-${{ inputs.build-target }}-Artifacts.zip'
0 commit comments