-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yaml
76 lines (68 loc) · 2.58 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: 'Unity Build (XRTK)'
description: 'Runs a Build using the specified build targets'
branding:
icon: 'box'
color: 'blue'
inputs:
build-target:
description: 'The build target to build for.'
# Unity -buildTarget command line args https://docs.unity3d.com/Manual/CommandLineArguments.html
# StandaloneWindows64, WSAPlayer, StandaloneOSX, iOS, StandaloneLinux64, Android, Lumin, WebGL
default: ''
test:
description: 'Run editor tests'
required: false
default: 'true'
additional-test-args:
description: 'Additional args to pass to test command'
required: false
default: ''
additional-build-args:
description: 'Additional args to pass to build command'
required: false
default: ''
publish-artifacts:
description: 'Should the workflow publish artifacts?'
required: false
default: 'true'
runs:
using: "composite"
steps:
- uses: xrtk/unity-action@v5
name: Project Validation
with:
log-name: 'project-validation'
args: '-quit -nographics -batchmode -executeMethod XRTK.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject'
- uses: xrtk/unity-action@v5
if: ${{ inputs.test == 'true' }}
name: '${{ inputs.build-target }}-Tests'
with:
log-name: '${{ inputs.build-target }}-Tests'
build-target: '${{ inputs.build-target }}'
args: '-nographics -batchmode -runEditorTests ${{ inputs.additional-test-args }}'
- uses: xrtk/unity-action@v5
name: '${{ inputs.build-target }}-Build'
with:
log-name: '${{ inputs.build-target }}-Build'
build-target: '${{ inputs.build-target }}'
args: '-quit -nographics -batchmode -executeMethod XRTK.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild ${{ inputs.additional-build-args }}'
- uses: josStorer/get-current-time@v2.0.2
if: ${{ always() && inputs.publish-artifacts == 'true' }}
id: current-time
with:
format: YYYY-MM-DDTHH-mm-ss-sss
- uses: actions/upload-artifact@v3
name: Upload Artifacts
if: ${{ always() && inputs.publish-artifacts == 'true' }}
with:
name: '${{ runner.os }}-${{ inputs.build-target }}-Artifacts-${{ steps.current-time.outputs.formattedTime }}'
path: '${{ env.UNITY_PROJECT_PATH }}/Builds'
- name: Clean Artifacts
if: ${{ always() && inputs.publish-artifacts == 'true' }}
run: |
# Clean Artifacts
$artifacts = "${{ env.UNITY_PROJECT_PATH }}/Builds"
if (Test-Path -Path $artifacts) {
Remove-Item $artifacts -Force -Recurse
}
shell: pwsh