@@ -2,10 +2,12 @@ name: Unity Actions
2
2
3
3
on :
4
4
pull_request : {}
5
- push : { branches: [main, master, develop] }
5
+ push : {}
6
6
7
7
env :
8
8
UNITY_LICENSE : ${{ secrets.UNITY_LICENSE }}
9
+ UNITY_EMAIL : ${{ secrets.UNITY_EMAIL }}
10
+ UNITY_PASSWORD : ${{ secrets.UNITY_PASSWORD }}
9
11
PROJECT_PATH : .
10
12
11
13
jobs :
@@ -30,10 +32,10 @@ jobs:
30
32
- name : Request manual activation file
31
33
id : getManualLicenseFile
32
34
# https://github.com/game-ci/unity-request-activation-file/releases/
33
- uses : game-ci/unity-request-activation-file@v2.0-alpha-1
35
+ uses : game-ci/unity-request-activation-file@v2
34
36
# Upload artifact (Unity_v20XX.X.XXXX.alf)
35
37
- name : Expose as artifact
36
- uses : actions/upload-artifact@v1
38
+ uses : actions/upload-artifact@v3
37
39
with :
38
40
name : ${{ steps.getManualLicenseFile.outputs.filePath }}
39
41
path : ${{ steps.getManualLicenseFile.outputs.filePath }}
@@ -44,24 +46,24 @@ jobs:
44
46
name : Test all modes ✨
45
47
runs-on : ubuntu-latest
46
48
steps :
47
- - uses : actions/checkout@v2
49
+ - uses : actions/checkout@v3
48
50
with :
49
51
lfs : true
50
- - uses : actions/cache@v2.1.3
52
+ - uses : actions/cache@v3
51
53
with :
52
54
path : Library
53
55
key : Library-test-project-${{ matrix.targetPlatform }}
54
56
restore-keys : |
55
57
Library-test-project-
56
58
Library-
57
59
# https://github.com/game-ci/unity-test-runner/releases/
58
- - uses : game-ci/unity-test-runner@v2.0-alpha-2
60
+ - uses : game-ci/unity-test-runner@v2
59
61
id : testRunner
60
62
with :
61
63
projectPath : ${{ env.PROJECT_PATH }}
62
64
testMode : all
63
65
customParameters : " -nographics"
64
- - uses : actions/upload-artifact@v2
66
+ - uses : actions/upload-artifact@v3
65
67
with :
66
68
name : Test results (all modes)
67
69
path : ${{ steps.testRunner.outputs.artifactsPath }}
@@ -75,31 +77,93 @@ jobs:
75
77
fail-fast : false
76
78
matrix :
77
79
targetPlatform :
78
- - StandaloneOSX
79
- - StandaloneWindows
80
- - StandaloneWindows64
81
80
- StandaloneLinux64
82
81
- iOS
83
82
- Android
84
- # See https://github.com/game-ci/docker/issues/53 webgl will be supported in editor image v0.9
85
- # - WebGL
83
+ - WebGL
86
84
steps :
87
- - uses : actions/checkout@v2
85
+ - uses : actions/checkout@v3
88
86
with :
89
87
lfs : true
90
- - uses : actions/cache@v2.1.3
88
+ - uses : actions/cache@v3
91
89
with :
92
90
path : ${{ matrix.projectPath }}/Library
93
91
key : Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}
94
92
restore-keys : |
95
93
Library-${{ matrix.projectPath }}-
96
94
Library-
97
95
# https://github.com/game-ci/unity-builder/releases/
98
-
96
+ - uses : game-ci/unity-builder@v2
97
+ with :
98
+ projectPath : ${{ env.PROJECT_PATH }}
99
+ targetPlatform : ${{ matrix.targetPlatform }}
100
+ - uses : actions/upload-artifact@v3
101
+ with :
102
+ name : Build-${{ matrix.targetPlatform }}
103
+ path : build
104
+
105
+ buildWithMac :
106
+ needs : [checklicense]
107
+ if : needs.checklicense.outputs.is_unity_license_set == 'true'
108
+ name : Build for ${{ matrix.targetPlatform }}
109
+ runs-on : macos-latest
110
+ strategy :
111
+ fail-fast : false
112
+ matrix :
113
+ targetPlatform :
114
+ - StandaloneOSX
115
+ steps :
116
+ - name : Checkout Repository
117
+ uses : actions/checkout@v3
118
+ with :
119
+ lfs : true
120
+ - uses : actions/cache@v3
121
+ with :
122
+ path : ${{ matrix.projectPath }}/Library
123
+ key : Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}
124
+ restore-keys : |
125
+ Library-${{ matrix.projectPath }}-
126
+ Library-
127
+ - uses : game-ci/unity-builder@v2
128
+ with :
129
+ projectPath : ${{ env.PROJECT_PATH }}
130
+ targetPlatform : ${{ matrix.targetPlatform }}
131
+ - name : Upload Build
132
+ uses : actions/upload-artifact@v3
133
+ with :
134
+ name : Build-${{ matrix.targetPlatform }}
135
+ path : build
136
+
137
+ buildWithWindows :
138
+ needs : [build, buildWithMac]
139
+ if : needs.checklicense.outputs.is_unity_license_set == 'true'
140
+ name : Build for ${{ matrix.targetPlatform }}
141
+ runs-on : windows-2019
142
+ strategy :
143
+ fail-fast : false
144
+ matrix :
145
+ targetPlatform :
146
+ - StandaloneWindows
147
+ - StandaloneWindows64
148
+ - WSAPlayer
149
+ steps :
150
+ - name : Checkout Repository
151
+ uses : actions/checkout@v3
152
+ with :
153
+ lfs : true
154
+ - uses : actions/cache@v3
155
+ with :
156
+ path : ${{ matrix.projectPath }}/Library
157
+ key : Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}
158
+ restore-keys : |
159
+ Library-${{ matrix.projectPath }}-
160
+ Library-
161
+ - uses : game-ci/unity-builder@v2
99
162
with :
100
163
projectPath : ${{ env.PROJECT_PATH }}
101
164
targetPlatform : ${{ matrix.targetPlatform }}
102
- - uses : actions/upload-artifact@v2
165
+ - name : Upload Build
166
+ uses : actions/upload-artifact@v3
103
167
with :
104
168
name : Build-${{ matrix.targetPlatform }}
105
169
path : build
0 commit comments