-
-
Notifications
You must be signed in to change notification settings - Fork 27
282 lines (251 loc) · 9.64 KB
/
build.yml
File metadata and controls
282 lines (251 loc) · 9.64 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
name: Build
# Controls when the workflow will run
on:
push:
# pull_request:
workflow_dispatch:
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: Library
key: Library-build-${{ github.ref }}
restore-keys: |
Library-build-
- uses: anatawa12/sh-actions/setup-vrc-get@master
- uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 5
retry_wait_seconds: 60
command: vrc-get resolve
- run: vrc-get info project
- name: Copy README
run: cp README.md Packages/com.github.kurotu.vrc-quest-tools/
- uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: StandaloneWindows
unityVersion: 2022.3.22f1
buildMethod: KRT.VRCQuestTools.VRCQuestTools.Export
allowDirtyBuild: true
versioning: None
- uses: actions/upload-artifact@v4
with:
name: unitypackage
path: VRCQuestTools.unitypackage
test:
name: test (${{matrix.sdk.unityVersion}}, sdk-${{matrix.sdk.name}}, deps-${{matrix.dependencies.name}})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk:
- name: minimum
unityVersion: 2022.3.22f1
vrcsdkVersion: 3.9.0 # required for new avatars
- name: latest
unityVersion: 2022.3.22f1
vrcsdkVersion: latest
dependencies:
- name: nothing
packages: []
- name: unsupported
packages:
- { name: nadena.dev.ndmf, version: '1.4.1' }
- { name: jp.lilxyzw.liltoon, version: '1.9.0' }
- name: minimum
packages:
- { name: nadena.dev.ndmf, version: '1.5.0' } # ndmf-preview
- { name: jp.lilxyzw.liltoon, version: '1.10.0' } # shadow ramp
- name: latest
packages:
- { name: nadena.dev.modular-avatar, version: 'latest' }
- { name: nadena.dev.ndmf, version: 'latest' }
- { name: jp.lilxyzw.liltoon, version: 'latest' }
# - { name: com.poiyomi.toon, version: 'latest' }
- name: ma-unsupported
packages:
- { name: nadena.dev.modular-avatar, version: '1.11.7' }
- name: ma-minimum
packages:
- { name: nadena.dev.modular-avatar, version: '1.12.2' } # world fixed object without error
- name: aao-minimum
packages:
- { name: com.anatawa12.avatar-optimizer, version: '1.8.14' } # compatible with SDK 3.9.0
- name: aao-latest
packages:
- { name: com.anatawa12.avatar-optimizer, version: 'latest' }
exclude:
- sdk:
name: latest
dependencies:
name: aao-minimum
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: Library
key: Library-test-${{ matrix.sdk.unityVersion }}-${{ matrix.sdk.vrcsdkVersion }}-${{ github.ref }}
restore-keys: |
Library-test-${{ matrix.sdk.unityVersion }}-${{ matrix.sdk.vrcsdkVersion }}
- uses: anatawa12/sh-actions/setup-vrc-get@master
- uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 5
retry_wait_seconds: 60
command: vrc-get resolve
- run: rm -r Packages/vpm-manifest.json Packages/com.vrchat.avatars Packages/com.vrchat.base
- name: Install VRChat SDK
run: |
scripts/vrc-get-install.sh com.vrchat.base ${{ matrix.sdk.vrcsdkVersion }}
scripts/vrc-get-install.sh com.vrchat.avatars ${{ matrix.sdk.vrcsdkVersion }}
- name: Add VPM repositories
run: |
vrc-get repo add https://vpm.nadena.dev/vpm.json
vrc-get repo add https://lilxyzw.github.io/vpm-repos/vpm.json
vrc-get repo add https://vpm.anatawa12.com/vpm.json
# vrc-get repo add https://poiyomi.github.io/vpm/index.json
- name: Install dependencies
run: |
for pkg in $(echo '${{ toJson(matrix.dependencies.packages) }}' | jq -c '.[]'); do
name=$(echo "$pkg" | jq -r '.name')
version=$(echo "$pkg" | jq -r '.version')
scripts/vrc-get-install.sh "$name" "$version"
done
- run: vrc-get info project
- uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
unityVersion: ${{ matrix.sdk.unityVersion }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
checkName: "Test Results: ${{matrix.sdk.unityVersion}}, sdk-${{matrix.sdk.name}}, deps-${{matrix.dependencies.name}}"
lint:
runs-on: ubuntu-latest
container: unityci/editor:ubuntu-2022.3.22f1-windows-mono-3
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: Library
key: Library-build-${{ github.ref }}
restore-keys: |
Library-build-
- uses: anatawa12/sh-actions/setup-vrc-get@master
- uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 5
retry_wait_seconds: 60
command: vrc-get resolve
- run: vrc-get info project
- run: vrc-get repo add https://vpm.nadena.dev/vpm-prerelease.json
- run: scripts/vrc-get-install.sh nadena.dev.modular-avatar latest
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
# See https://github.com/game-ci/documentation/issues/408#issuecomment-3211109962 for UNITY_SERIAL
- name: Generate Solution
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
UNITY_COMMAND: unity-editor
run: |
for i in $(seq 1 10); do
if ./.github/workflows/unity.sh -batchmode -nographics -logFile /dev/stdout -projectPath . -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -quit; then
exit 0
fi
if [ "$i" -lt 10 ]; then
echo "Attempt $i failed. Retrying in 5 minutes..."
sleep 300
fi
done
exit 1
- name: Add dotnet problem matcher
run: echo "::add-matcher::.github/problem-matchers/csc.json"
- name: Check style
run: ./scripts/lint.sh | tee lint.log
env:
DOTNET_CLI_UI_LANGUAGE: en
- name: Upload lint log
uses: actions/upload-artifact@v4
if: always()
with:
name: lint
path: lint.log
vpm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Copy README
run: cp README.md Packages/com.github.kurotu.vrc-quest-tools/
- name: Make zip
run: |
cd Packages/com.github.kurotu.vrc-quest-tools
zip -r ../../$(jq -r '.name' package.json)-$(jq -r '.version' package.json).zip $(ls)
- uses: actions/upload-artifact@v4
with:
name: vpm
path: "*.zip"
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
cache: 'pnpm'
cache-dependency-path: Website/pnpm-lock.yaml
- run: cd Website && pnpm install --frozen-lockfile
- run: cd Website && pnpm run build
release:
if: startsWith(github.ref, 'refs/tags/')
needs: [build, test, lint, vpm, docs]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: unitypackage
- uses: actions/download-artifact@v4
with:
name: vpm
- name: Create release artifact
id: artifact
run: |
NAME=VRCQuestTools-${GITHUB_REF#refs/tags/}
mkdir ${NAME}
cp VRCQuestTools.unitypackage ${NAME}/${NAME}.unitypackage
cp LICENSE.txt ${NAME}/
cp README*.md ${NAME}/
cp .github/workflows/Add\ to\ VCC.url ${NAME}/
zip -r ${NAME}.zip ${NAME}
echo "::set-output name=artifact-name::${NAME}"
- name: Generate release note
run: ./scripts/generate-releasenote.sh ${GITHUB_REF#refs/tags/v} | tee ${{ github.workspace }}-release.txt
- uses: softprops/action-gh-release@v1
with:
body_path: ${{ github.workspace }}-release.txt
draft: true
prerelease: ${{ contains(github.ref, '-') }}
files: |
Packages/com.github.kurotu.vrc-quest-tools/package.json
*.zip
${{ steps.artifact.outputs.artifact-name }}/${{ steps.artifact.outputs.artifact-name }}.unitypackage