-
Notifications
You must be signed in to change notification settings - Fork 20
504 lines (449 loc) · 15.3 KB
/
windows-release.yml
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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
name: Make a Release
on:
workflow_dispatch:
inputs:
tag:
description: 'which tag to create and release?'
required: true
default: 'nightly'
model-tags:
description: 'which tag(s) of model release to use? (comma-separated list of tags)'
required: true
default: 'model-20211209, model-20220923'
ext-model-tags:
description: 'which tag(s) of external model release to use?'
required: true
default: 'external-models'
contrib-model-tags:
description: 'which tag(s) of contributed model release to use?'
required: true
default: 'contrib-models'
ov_tag:
description: 'which tag of openvino to use'
required: true
default: 'latest'
type: string
ncnn_tag:
description: 'which tag of ncnn to use'
required: true
default: 'latest'
type: string
jobs:
build-vsov:
uses: ./.github/workflows/windows-ov.yml
with:
tag: ${{ github.event.inputs.tag }}
ov_tag: ${{ github.event.inputs.ov_tag }}
build-vsort:
uses: ./.github/workflows/windows-ort.yml
with:
tag: ${{ github.event.inputs.tag }}
build-vstrt:
uses: ./.github/workflows/windows-trt.yml
with:
tag: ${{ github.event.inputs.tag }}
secrets:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
build-vsmigx:
uses: ./.github/workflows/windows-migx.yml
with:
tag: ${{ github.event.inputs.tag }}
secrets:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
build-vsncnn:
uses: ./.github/workflows/windows-ncnn.yml
with:
tag: ${{ github.event.inputs.tag }}
ncnn_tag: ${{ github.event.inputs.ncnn_tag }}
build-cuda-dependency:
uses: ./.github/workflows/windows-cuda-dependency.yml
with:
tag: ${{ github.event.inputs.tag }}
secrets:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
build-hip-dependency:
uses: ./.github/workflows/windows-hip-dependency.yml
with:
tag: ${{ github.event.inputs.tag }}
secrets:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
build-scripts:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Compress scirpts.7z
run: |
cd scripts
7za a -t7z -bb3 -mx=9 ../scripts.${{ github.event.inputs.tag }}.7z .
- name: Upload scripts release
uses: actions/upload-artifact@v4
with:
name: Scripts
path: scripts
retention-days: 1
- name: Release scripts
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag }}
files: scripts.${{ github.event.inputs.tag }}.7z
fail_on_unmatched_files: true
generate_release_notes: false
prerelease: true
build-models:
runs-on: ubuntu-latest
steps:
- name: Download Models
run: |
set -ex
mkdir -p release/models
cd release
pushd models
for tag in $(echo "${{ github.event.inputs.model-tags }}" | tr ',' ' '); do
echo "Handling tag $tag"
curl -s https://api.github.com/repos/AmusementClub/vs-mlrt/releases/tags/"$tag" > release.json
for url in $(cat release.json | jq '.assets | .[] | .url ' | tr -d '"'); do
echo "Downloading $url"
curl -o dl.7z -LJ -H 'Accept: application/octet-stream' "$url"
# later release should overwrite earlier ones
7za x -y dl.7z
done
test -f "dl.7z"
rm -f dl.7z release.json
done
popd
ls -lR
du -sh
7za a -t7z -bb3 -mx=9 ../models.7z .
- name: Upload model release
uses: actions/upload-artifact@v4
with:
name: Models
path: release
retention-days: 1
compression-level: 0
- name: Download External Models
if: false
run: |
rm -rf release
set -ex
mkdir -p release/models
cd release
pushd models
for tag in $(echo "${{ github.event.inputs.ext-model-tags }}" | tr ',' ' '); do
echo "Handling tag $tag"
curl -s https://api.github.com/repos/AmusementClub/vs-mlrt/releases/tags/"$tag" > release.json
for url in $(cat release.json | jq '.assets | .[] | .url ' | tr -d '"'); do
echo "Downloading $url"
curl -o dl.7z -LJ -H 'Accept: application/octet-stream' "$url"
# later release should overwrite earlier ones
7za x -y dl.7z
done
test -f "dl.7z"
rm -f dl.7z release.json
done
popd
ls -lR
du -sh
7za a -t7z -bb3 -mx=9 ../ext-models.7z . -v2g
- name: Upload external model release
uses: actions/upload-artifact@v4
if: false
with:
name: External-Models
path: release
retention-days: 1
compression-level: 0
- name: Download Contributed Models
run: |
rm -rf release
set -ex
mkdir -p release/models
cd release
pushd models
for tag in $(echo "${{ github.event.inputs.contrib-model-tags }}" | tr ',' ' '); do
echo "Handling tag $tag"
curl -s https://api.github.com/repos/AmusementClub/vs-mlrt/releases/tags/"$tag" > release.json
for url in $(cat release.json | jq '.assets | .[] | .url ' | tr -d '"'); do
echo "Downloading $url"
curl -o dl.7z -LJ -H 'Accept: application/octet-stream' "$url"
# later release should overwrite earlier ones
7za x -y dl.7z
done
#test -f "dl.7z" # contrib-models might be empty.
rm -f dl.7z release.json
done
popd
ls -lR
du -sh
7za a -t7z -bb3 -mx=9 ../contrib-models.7z .
- name: Upload contrib model release
uses: actions/upload-artifact@v4
with:
name: Contrib-Models
path: release
retention-days: 1
compression-level: 0
- name: Download Contributed Models
run: |
rm -rf release
set -ex
mkdir -p release/models
cd release
pushd models
for tag in $(echo "${{ github.event.inputs.contrib-model-tags }}" | tr ',' ' '); do
echo "Handling tag $tag"
curl -s https://api.github.com/repos/AmusementClub/vs-mlrt/releases/tags/"$tag" > release.json
for url in $(cat release.json | jq '.assets | .[] | .url ' | tr -d '"'); do
echo "Downloading $url"
curl -o dl.7z -LJ -H 'Accept: application/octet-stream' "$url"
# later release should overwrite earlier ones
7za x -y dl.7z
done
#test -f "dl.7z" # contrib-models might be empty.
rm -f dl.7z release.json
done
popd
ls -lR
du -sh
7za a -t7z -bb3 -mx=9 ../contrib-models.7z .
- name: Rename release asset
run: |
mv models.7z models.${{ github.event.inputs.tag }}.7z
mv contrib-models.7z contrib-models.${{ github.event.inputs.tag }}.7z
- name: Release models
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag }}
files: |
models.${{ github.event.inputs.tag }}.7z
contrib-models.${{ github.event.inputs.tag }}.7z
fail_on_unmatched_files: true
generate_release_notes: false
prerelease: true
release:
runs-on: ubuntu-latest
needs: [build-vsov, build-vsort, build-vstrt, build-vsmigx, build-vsncnn, build-cuda-dependency, build-hip-dependency, build-scripts, build-models]
defaults:
run:
shell: bash
steps:
- name: Download artifact for scripts
uses: actions/download-artifact@v4
with:
name: Scripts
path: scripts-release
- name: Download artifact for models
uses: actions/download-artifact@v4
with:
name: Models
path: models-release
- name: Download artifact for vsov
uses: actions/download-artifact@v4
with:
name: VSOV-Windows-x64
path: vsov-release
- name: Download artifact for vsort
uses: actions/download-artifact@v4
with:
name: VSORT-Windows-x64
path: vsort-release
- name: Download artifact for vstrt
uses: actions/download-artifact@v4
with:
name: VSTRT-Windows-x64
path: vstrt-release
- name: Download artifact for vsmigx
uses: actions/download-artifact@v4
with:
name: VSMIGX-Windows-x64
path: vsmigx-release
- name: Download artifact for vsncnn
uses: actions/download-artifact@v4
with:
name: VSNCNN-GPU-Windows-x64
path: vsncnn-release
- name: Download artifact for cuda dependencies
uses: actions/download-artifact@v4
with:
name: vsmlrt-cuda
path: cuda-release
- name: Download artifact for hip dependencies
uses: actions/download-artifact@v4
with:
name: vsmlrt-hip
path: hip-release
- name: Build CPU-only release
shell: bash
run: |
mkdir release-cpu
cp -r models-release/models release-cpu/
cp -r vsov-release/* release-cpu/
cp -r vsort-release/* release-cpu/
rm -f release-cpu/vsort/onnxruntime_providers_*.dll
cp scripts-release/*.py release-cpu/
cd release-cpu
ls -lR
7za a -t7z -bb3 -mx=9 ../vsmlrt-windows-x64-cpu.7z .
- name: Upload CPU-only release
uses: actions/upload-artifact@v4
if: false
with:
name: vsmlrt-cpu-release
path: vsmlrt-windows-x64-cpu.7z
retention-days: 1
compression-level: 0
- name: Rename release asset
run: mv vsmlrt-windows-x64-cpu.7z vsmlrt-windows-x64-cpu.${{ github.event.inputs.tag }}.7z
- name: Release CPU
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag }}
files: vsmlrt-windows-x64-cpu.${{ github.event.inputs.tag}}.7z
fail_on_unmatched_files: true
generate_release_notes: false
prerelease: true
- name: Build generic GPU release
shell: bash
run: |
mkdir release-generic-gpu
cp -r models-release/models release-generic-gpu/
cp -r vsov-release/* release-generic-gpu/
cp -r vsort-release/* release-generic-gpu/
rm -f release-generic-gpu/vsort/onnxruntime_providers_*.dll
cp -r vsncnn-release/* release-generic-gpu/
cp scripts-release/*.py release-generic-gpu/
cd release-generic-gpu
ls -lR
7za a -t7z -bb3 -mx=9 ../vsmlrt-windows-x64-generic-gpu.7z .
- name: Upload generic GPU release
uses: actions/upload-artifact@v4
if: false
with:
name: vsmlrt-generic-gpu-release
path: vsmlrt-windows-x64-generic-gpu.7z
retention-days: 1
compression-level: 0
- name: Rename release asset for generic GPU release
run: mv vsmlrt-windows-x64-generic-gpu.7z vsmlrt-windows-x64-generic-gpu.${{ github.event.inputs.tag }}.7z
- name: Release generic GPU
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag }}
files: vsmlrt-windows-x64-generic-gpu.${{ github.event.inputs.tag }}.7z
fail_on_unmatched_files: true
generate_release_notes: false
prerelease: true
- name: Extract CUDA libraries
run: |
cd cuda-release
7za x -bb3 vsmlrt-cuda.7z
rm vsmlrt-cuda.7z
- name: Build CUDA release
shell: bash
run: |
mkdir release-cuda
cp -r models-release/models release-cuda/
cp -r vsov-release/* release-cuda/
cp -r vsort-release/* release-cuda/
cp -r vstrt-release/* release-cuda/
cp -r vsncnn-release/* release-cuda/
cp -r cuda-release/* release-cuda/
cp scripts-release/*.py release-cuda/
cd release-cuda
ls -lR
7za a -t7z -bb3 -mx=9 ../vsmlrt-windows-x64-cuda.7z .
- name: Upload CUDA release
uses: actions/upload-artifact@v4
if: false
with:
name: vsmlrt-cuda-release
path: vsmlrt-windows-x64-cuda.7z
retention-days: 1
compression-level: 0
- name: Rename release asset for CUDA release
run: mv vsmlrt-windows-x64-cuda.7z vsmlrt-windows-x64-cuda.${{ github.event.inputs.tag }}.7z
- name: Release CUDA
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag }}
files: vsmlrt-windows-x64-cuda.${{ github.event.inputs.tag }}.7z
fail_on_unmatched_files: true
generate_release_notes: false
prerelease: true
- name: Build TensorRT release
shell: bash
run: |
cd release-cuda
cd vsmlrt-cuda
rm --verbose cublas*.dll cudnn*.dll cufft*.dll cupti*.dll nvblas*.dll
cd ..
rm --verbose vsort/onnxruntime_providers_*.dll
7za a -t7z -bb3 -mx=9 ../vsmlrt-windows-x64-tensorrt.7z .
- name: Upload TensorRT release
uses: actions/upload-artifact@v4
if: false
with:
name: vsmlrt-tensorrt-release
path: vsmlrt-windows-x64-tensorrt.7z
retention-days: 1
compression-level: 0
- name: Rename release asset for TensorRT release
run: mv vsmlrt-windows-x64-tensorrt.7z vsmlrt-windows-x64-tensorrt.${{ github.event.inputs.tag }}.7z
- name: Release TensorRT
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag }}
files: vsmlrt-windows-x64-tensorrt.${{ github.event.inputs.tag }}.7z
fail_on_unmatched_files: true
generate_release_notes: false
prerelease: true
- name: Extract HIP libraries
run: |
cd hip-release
7za x -bb3 vsmlrt-hip.7z
rm vsmlrt-hip.7z
- name: Build MIGraphX release
shell: bash
run: |
mkdir release-hip
cp -r models-release/models release-hip/
cp -r vsov-release/* release-hip/
cp -r vsort-release/* release-hip/
cp -r vsmigx-release/* release-hip/
cp -r vsncnn-release/* release-hip/
cp -r hip-release/* release-hip/
cp scripts-release/*.py release-hip/
cd release-hip
ls -lR
7za a -t7z -bb3 -mx=9 ../vsmlrt-windows-x64-migraphx.7z .
- name: Upload MIGraphX release
uses: actions/upload-artifact@v4
if: false
with:
name: vsmlrt-migraphx-release
path: vsmlrt-windows-x64-migraphx.7z
retention-days: 1
compression-level: 0
- name: Rename release asset for MIGraphX release
run: mv vsmlrt-windows-x64-migraphx.7z vsmlrt-windows-x64-migraphx.${{ github.event.inputs.tag }}.7z
- name: Release MIGraphX
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag }}
files: vsmlrt-windows-x64-migraphx.${{ github.event.inputs.tag }}.7z
fail_on_unmatched_files: true
generate_release_notes: false
prerelease: true
# Update nightly tag.
- name: Checkout repo
if: github.event.inputs.tag == 'nightly'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Overwrite tag
if: github.event.inputs.tag == 'nightly'
run: |
git pull --tags --force
git tag -f ${{ github.event.inputs.tag }}
git push -f origin ${{ github.event.inputs.tag }}