-
Notifications
You must be signed in to change notification settings - Fork 206
566 lines (487 loc) · 22.6 KB
/
build.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
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
name: build
on:
push:
branches:
- master
release:
types:
- created
workflow_dispatch:
inputs:
version:
description: "バージョン情報(A.BB.C / A.BB.C-preview.D)"
required: true
prerelease:
description: "プレリリースかどうか"
type: boolean
default: true
code_signing:
description: "コード署名する"
type: boolean
env:
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/voicevox_engine
PYTHON_VERSION: "3.8.10"
VOICEVOX_RESOURCE_VERSION: "0.13.2"
VOICEVOX_CORE_VERSION: "0.14.0-preview.2"
VOICEVOX_ENGINE_VERSION:
|- # releaseタグ名か、workflow_dispatchでのバージョン名か、latestが入る
${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}
jobs:
build-all:
environment: ${{ github.event.inputs.code_signing == 'true' && 'code_signing' || '' }} # コード署名用のenvironment
strategy:
matrix:
include:
# Windows CPU
- os: windows-2019
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-windows-x64-cpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.11.1/onnxruntime-win-x64-1.11.1.zip
artifact_name: windows-cpu
# Windows DirectML
- os: windows-2019
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-windows-x64-directml
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.11.1/Microsoft.ML.OnnxRuntime.DirectML.1.11.1.zip
directml_url: https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/1.9.0
artifact_name: windows-directml
# Windows NVIDIA GPU
- os: windows-2019
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-windows-x64-cuda
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.11.1/onnxruntime-win-x64-gpu-1.11.1.zip
cuda_version: "11.6.0"
cudnn_url: https://developer.download.nvidia.com/compute/redist/cudnn/v8.4.1/local_installers/11.6/cudnn-windows-x86_64-8.4.1.50_cuda11.6-archive.zip
artifact_name: windows-nvidia
# Mac CPU (x64 arch only)
- os: macos-11
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-osx-x64-cpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.11.1/onnxruntime-osx-x86_64-1.11.1.tgz
artifact_name: macos-x64
# Linux CPU
- os: ubuntu-20.04
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-linux-x64-cpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.11.1/onnxruntime-linux-x64-1.11.1.tgz
artifact_name: linux-cpu
# Linux NVIDIA GPU
- os: ubuntu-20.04
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-linux-x64-gpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.11.1/onnxruntime-linux-x64-gpu-1.11.1.tgz
cuda_version: "11.6.0"
cudnn_url: https://developer.download.nvidia.com/compute/redist/cudnn/v8.4.1/local_installers/11.6/cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive.tar.xz
artifact_name: linux-nvidia
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Show disk space (debug info)
shell: bash
run: |
df -h
# NOTE: The default sed of macOS is BSD sed.
# There is a difference in specification between BSD sed and GNU sed,
# so you need to install GNU sed.
- name: Install GNU sed on macOS
if: startsWith(matrix.os, 'macos-')
shell: bash
run: brew install gnu-sed
# ONNX Runtime providersとCUDA周りをリンクするために使う
- name: Install patchelf
if: startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.artifact_name, 'nvidia')
run: |
sudo apt-get update
sudo apt-get install -y patchelf
# Download CUDA
- name: Prepare CUDA DLL cache
if: matrix.cuda_version != ''
uses: actions/cache@v3
id: cuda-dll-cache
with:
# update this key when ONNX Runtime CUDA dependency changed
key: ${{ matrix.os }}-cuda-dll-${{ matrix.cuda_version }}-v1
path: download/cuda
- name: Setup CUDA
if: matrix.cuda_version != '' && steps.cuda-dll-cache.outputs.cache-hit != 'true'
uses: Jimver/[email protected]
id: cuda-toolkit
with:
method: network
cuda: ${{ matrix.cuda_version }}
- name: Extract CUDA Dynamic Libraries
if: matrix.cuda_version != '' && steps.cuda-dll-cache.outputs.cache-hit != 'true'
shell: bash
run: |
set -eux
CUDA_ROOT=$( echo "${{ steps.cuda-toolkit.outputs.CUDA_PATH }}" | tr '\\' '/' )
mkdir -p download/cuda/bin
if [[ ${{ matrix.os }} == windows-* ]]; then
mv "${CUDA_ROOT}/bin/"*.dll download/cuda/bin/
rm -rf "${CUDA_ROOT}"
else
cp "${CUDA_ROOT}/lib64/"libcublas.so.* download/cuda/bin/
cp "${CUDA_ROOT}/lib64/"libcublasLt.so.* download/cuda/bin/
cp "${CUDA_ROOT}/lib64/"libcudart.so.* download/cuda/bin/
cp "${CUDA_ROOT}/lib64/"libcufft.so.* download/cuda/bin/
cp "${CUDA_ROOT}/lib64/"libcurand.so.* download/cuda/bin/
# remove unneed full version libraries
rm -f download/cuda/bin/libcublas.so.*.*
rm -f download/cuda/bin/libcublasLt.so.*.*
rm -f download/cuda/bin/libcufft.so.*.*
rm -f download/cuda/bin/libcurand.so.*.*
rm -f download/cuda/bin/libcudart.so.*.*.*
fi
- name: Show disk space (debug info)
if: matrix.cuda_version != ''
shell: bash
run: |
df -h
# Download cuDNN
- name: Export cuDNN url to calc hash
if: matrix.cudnn_url != ''
shell: bash
run: echo "${{ matrix.cudnn_url }}" > download/cudnn_url.txt
- name: Prepare cuDNN cache
if: matrix.cudnn_url != ''
uses: actions/cache@v3
id: cudnn-dll-cache
with:
# update this key when ONNX Runtime cuDNN dependency changed
key: ${{ matrix.os }}-cudnn-dll-${{ hashFiles('download/cudnn_url.txt') }}-v1
path: download/cudnn
- name: Download and extract cuDNN Dynamic Libraries
if: matrix.cudnn_url != '' && steps.cudnn-dll-cache.outputs.cache-hit != 'true'
shell: bash
run: |
set -eux
if [[ ${{ matrix.os }} == windows-* ]]; then
curl -L "${{ matrix.cudnn_url }}" > download/cudnn.zip
unzip download/cudnn.zip cudnn-*/bin/*.dll -d download/cudnn_tmp
mkdir -p download/cudnn/bin
mv download/cudnn_tmp/cudnn-*/bin/*.dll download/cudnn/bin/
rm -rf download/cudnn_tmp
rm download/cudnn.zip
else
curl -L "${{ matrix.cudnn_url }}" > download/cudnn.tar.xz
tar -Jxf download/cudnn.tar.xz -C download/
mkdir -p download/cudnn/bin
cp download/cudnn-*/lib/libcudnn.so.* download/cudnn/bin/
cp download/cudnn-*/lib/libcudnn_*_infer.so.* download/cudnn/bin/
# remove unneed full version libraries
rm -f download/cudnn/bin/libcudnn.so.*.*
rm -f download/cudnn/bin/libcudnn_*_infer.so.*.*
rm download/cudnn.tar.xz
fi
- name: Show disk space (debug info)
if: matrix.cudnn_url != ''
shell: bash
run: |
df -h
- name: Setup MSVC
if: startsWith(matrix.os, 'windows-')
uses: ilammy/msvc-dev-cmd@v1
# Python install path of windows: C:/hostedtoolcache/windows/Python
- name: Setup Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: ${{ matrix.architecture }}
cache: pip
- name: Install Python dependencies
shell: bash
run: |
python -m pip install -r requirements-dev.txt
# Download pyopenjtalk dictionary
# try 5 times, sleep 5 seconds before retry
for i in $(seq 5); do
EXIT_CODE=0
python3 -c "import pyopenjtalk; pyopenjtalk._lazy_init()" || EXIT_CODE=$?
if [ "$EXIT_CODE" = "0" ]; then
break
fi
sleep 5
done
if [ "$EXIT_CODE" != "0" ]; then
exit "$EXIT_CODE"
fi
- name: Create download directory
shell: bash
run: mkdir -p download/
# Donwload DirectML
- name: Export DirectML url to calc hash
if: endswith(matrix.artifact_name, '-directml')
shell: bash
run: echo "${{ matrix.directml_url }}" >> download/directml_url.txt
- name: Cache DirectML
if: endswith(matrix.artifact_name, '-directml')
uses: actions/cache@v3
id: directml-cache
with:
key: directml-cache-v1-${{ hashFiles('download/directml_url.txt') }}
path: download/directml
- name: Download DirectML
if: steps.directml-cache.outputs.cache-hit != 'true' && endswith(matrix.artifact_name, '-directml')
shell: bash
run: |
curl -L "${{ matrix.directml_url }}" -o download/directml.zip
mkdir -p download/directml
# extract only dlls
unzip download/directml.zip bin/${{ matrix.architecture }}-win/DirectML.dll -d download/directml
rm download/directml.zip
mv download/directml/bin/${{ matrix.architecture }}-win/DirectML.dll download/directml/DirectML.dll
rm -r download/directml/bin
# Download ONNX Runtime
- name: Export ONNX Runtime url to calc hash
shell: bash
run: echo "${{ matrix.onnxruntime_url }}" > download/onnxruntime_url.txt
- name: Prepare ONNX Runtime cache
uses: actions/cache@v3
id: onnxruntime-cache
with:
key: ${{ matrix.os }}-onnxruntime-${{ hashFiles('download/onnxruntime_url.txt') }}-v1
path: download/onnxruntime
- name: Download ONNX Runtime (Windows)
if: steps.onnxruntime-cache.outputs.cache-hit != 'true' && startsWith(matrix.os, 'windows-')
shell: bash
run: |
curl -L "${{ matrix.onnxruntime_url }}" > download/onnxruntime.zip
# extract only dlls
if [[ ${{ matrix.artifact_name }} != *-directml ]]; then
unzip download/onnxruntime.zip onnxruntime-*/lib/*.dll -d download/
mv download/onnxruntime-* download/onnxruntime
else
mkdir -p download/onnxruntime/lib
unzip download/onnxruntime.zip runtimes/win-${{ matrix.architecture }}/native/*.dll -d download/onnxruntime
mv download/onnxruntime/runtimes/win-${{ matrix.architecture }}/native/*.dll download/onnxruntime/lib/
rm -r download/onnxruntime/runtimes
fi
rm download/onnxruntime.zip
- name: Download ONNX Runtime (Mac/Linux)
if: steps.onnxruntime-cache.outputs.cache-hit != 'true' && startsWith(matrix.os, 'windows-') != true
shell: bash
run: |
curl -L "${{ matrix.onnxruntime_url }}" > download/onnxruntime.tgz
mkdir -p download/onnxruntime
tar xf "download/onnxruntime.tgz" -C "download/onnxruntime" --strip-components 1
rm download/onnxruntime.tgz
- name: Show disk space (debug info)
shell: bash
run: |
df -h
# Download VOICEVOX RESOURCE
- name: Prepare VOICEVOX RESOURCE cache
uses: actions/cache@v3
id: voicevox-resource-cache
with:
key: voicevox-resource-${{ env.VOICEVOX_RESOURCE_VERSION }}
path: download/resource
- name: Checkout VOICEVOX RESOURCE
if: steps.voicevox-resource-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: VOICEVOX/voicevox_resource
ref: ${{ env.VOICEVOX_RESOURCE_VERSION }}
path: download/resource
# Merge VOICEVOX RESOURCE
- name: Merge VOICEVOX RESOURCE
shell: bash
env:
DOWNLOAD_RESOURCE_PATH: download/resource
run: bash build_util/merge_voicevox_resource.bash
# Download VOICEVOX Core
- name: Prepare VOICEVOX Core cache
uses: actions/cache@v3
id: voicevox-core-cache
with:
key: ${{ matrix.os }}-voicevox-core-${{ matrix.voicevox_core_asset_prefix }}-${{ env.VOICEVOX_CORE_VERSION }}
path: download/core
- name: Download VOICEVOX Core
if: steps.voicevox-core-cache.outputs.cache-hit != 'true'
shell: bash
env:
VOICEVOX_CORE_ASSET_NAME: ${{ matrix.voicevox_core_asset_prefix }}-${{ env.VOICEVOX_CORE_VERSION }}
run: |
curl -L "https://github.com/VOICEVOX/voicevox_core/releases/download/${{ env.VOICEVOX_CORE_VERSION }}/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip" > download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip
# NOTE: Windows 版コアのみ PowerShell の Compress-Archive コマンドレットを用いて zip を作成している(デフォルト状態では zip コマンドが存在していないため)。
# このコマンドはバージョンによっては作成した zip 内のパスの区切り文字がバックスラッシュになる。 (cf. https://github.com/PowerShell/Microsoft.PowerShell.Archive/issues/48)
# unzip コマンドはこのような zip ファイルを解凍できるものの、終了コード 1 を報告して CI が落ちてしまう。
# 回避策として、unzip コマンドの代わりに 7z コマンドを用いて zip ファイルを解凍する。
# unzip download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip -d download/
if [[ ${{ matrix.os }} == windows-* ]]; then
7z x -o"download" download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip
elif [[ ${{ matrix.os }} == mac-* ]]; then
ditto -x -k --sequesterRsrc --rsrc download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip download/
else
unzip download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip -d download/
fi
mkdir -p download/core
mv download/${{ env.VOICEVOX_CORE_ASSET_NAME }}/* download/core
rm -rf download/${{ env.VOICEVOX_CORE_ASSET_NAME }}
rm download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip
- name: Generate licenses.json
shell: bash
run: |
python generate_licenses.py > engine_manifest_assets/dependency_licenses.json
# FIXME: VOICEVOX (editor) cannot build without licenses.json
cp engine_manifest_assets/dependency_licenses.json licenses.json
- name: Show disk space (debug info)
shell: bash
run: |
df -h
- name: Build run.py with PyInstaller
shell: bash
run: |
set -eux
# Replace version & specify dynamic libraries
if [[ ${{ matrix.os }} == macos-* ]]; then
gsed -i "s/__version__ = \"latest\"/__version__ = \"${{ env.VOICEVOX_ENGINE_VERSION }}\"/" voicevox_engine/__init__.py
LIBCORE_PATH=download/core/libvoicevox_core.dylib
LIBONNXRUNTIME_PATH=download/onnxruntime/lib/libonnxruntime.dylib
else
sed -i "s/__version__ = \"latest\"/__version__ = \"${{ env.VOICEVOX_ENGINE_VERSION }}\"/" voicevox_engine/__init__.py
if [[ ${{ matrix.os }} == windows-* ]]; then
LIBCORE_PATH=download/core/voicevox_core.dll
LIBONNXRUNTIME_PATH=download/onnxruntime/lib/onnxruntime.dll
else
LIBCORE_PATH=download/core/libvoicevox_core.so
LIBONNXRUNTIME_PATH=download/onnxruntime/lib/libonnxruntime.so
fi
fi
LIBCORE_PATH="$LIBCORE_PATH" \
LIBONNXRUNTIME_PATH="$LIBONNXRUNTIME_PATH" \
pyinstaller --noconfirm run.spec
- name: Show disk space (debug info)
shell: bash
run: |
df -h
- name: Create artifact directory with symlink
if: startsWith(matrix.os, 'windows-')
shell: bash
env:
PYTHON_SITE_PACKAGES_DIR: C:/hostedtoolcache/windows/python/${{ steps.setup-python.outputs.python-version }}/x64/lib/site-packages
# create symlink instead of copy (Git Bash)
# https://qiita.com/ucho/items/c5ea0beb8acf2f1e4772
MSYS: winsymlinks:nativestrict
run: |
set -eux
# Copy DLL dependencies
if [ -f "download/onnxruntime/lib/onnxruntime_providers_cuda.dll" ]; then
# ONNX Runtime providers (PyInstaller does not copy dynamic loaded libraries)
ln -sf "$(pwd)/download/onnxruntime/lib"/onnxruntime_*.dll dist/run/
# CUDA
ln -sf "$(pwd)/download/cuda/bin"/cublas64_*.dll dist/run/
ln -sf "$(pwd)/download/cuda/bin"/cublasLt64_*.dll dist/run/
ln -sf "$(pwd)/download/cuda/bin"/cudart64_*.dll dist/run/
ln -sf "$(pwd)/download/cuda/bin"/cufft64_*.dll dist/run/
ln -sf "$(pwd)/download/cuda/bin"/curand64_*.dll dist/run/
# cuDNN
ln -sf "$(pwd)/download/cudnn/bin"/cudnn64_*.dll dist/run/
ln -sf "$(pwd)/download/cudnn/bin"/cudnn_*_infer64*.dll dist/run/
fi
if [[ ${{ matrix.artifact_name }} == *-directml ]]; then
# DirectML
ln -sf "$(pwd)/download/directml"/DirectML.dll dist/run/
fi
- name: Create symlink of CUDA dependencies
if: startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.artifact_name, 'nvidia')
shell: bash
run: |
set -eux
# ONNX Runtime providers (PyInstaller does not copy dynamic loaded libraries)
patchelf --set-rpath '$ORIGIN' "$(pwd)/download/onnxruntime/lib"/libonnxruntime_providers_*.so
ln -sf "$(pwd)/download/onnxruntime/lib"/libonnxruntime_*.so dist/run/
# CUDA
ln -sf "$(pwd)/download/cuda/bin"/libcublas.so.* dist/run/
ln -sf "$(pwd)/download/cuda/bin"/libcublasLt.so.* dist/run/
ln -sf "$(pwd)/download/cuda/bin"/libcudart.so.* dist/run/
ln -sf "$(pwd)/download/cuda/bin"/libcufft.so.* dist/run/
ln -sf "$(pwd)/download/cuda/bin"/libcurand.so.* dist/run/
# cuDNN
ln -sf "$(pwd)/download/cudnn/bin"/libcudnn.so.* dist/run/
ln -sf "$(pwd)/download/cudnn/bin"/libcudnn_*_infer.so.* dist/run/
- name: Set @rpath to @executable_path
if: startsWith(matrix.os, 'macos-')
run: |
install_name_tool -add_rpath @executable_path/. dist/run/run
- name: Code signing
if: github.event.inputs.code_signing == 'true' && startsWith(matrix.os, 'windows-')
shell: bash
run: |
bash build_util/codesign.bash "dist/run/run.exe"
env:
CERT_BASE64: ${{ secrets.CERT_BASE64 }}
CERT_PASSWORD: ${{ secrets.CERT_PASSWORD }}
# FIXME: versioned name may be useful; but
# actions/download-artifact and dawidd6/download-artifact do not support
# wildcard / forward-matching yet.
# Currently, It is good to use static artifact name for future binary test workflow.
# https://github.com/actions/toolkit/blob/ea81280a4d48fb0308d40f8f12ae00d117f8acb9/packages/artifact/src/internal/artifact-client.ts#L147
# https://github.com/dawidd6/action-download-artifact/blob/af92a8455a59214b7b932932f2662fdefbd78126/main.js#L113
- name: Upload artifact
uses: actions/upload-artifact@v3
# env:
# VERSIONED_ARTIFACT_NAME: |
# ${{ format('{0}-{1}', matrix.artifact_name, (env.VOICEVOX_ENGINE_VERSION != 'latest' && env.VOICEVOX_ENGINE_VERSION) || github.sha) }}
with:
name: ${{ matrix.artifact_name }}
path: dist/run/
upload-to-release:
if: (github.event.release.tag_name || github.event.inputs.version) != ''
needs: [build-all]
runs-on: ubuntu-latest
strategy:
matrix:
artifact_name:
- macos-x64
- linux-cpu
- linux-nvidia
- windows-cpu
- windows-directml
- windows-nvidia
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
p7zip-full
- name: Download and extract artifact
uses: actions/download-artifact@v3
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.artifact_name }}/
- name: Rearchive and split artifact
run: |
# Compress to artifact.7z.001, artifact.7z.002, ...
7z -r -v2g a "${{ matrix.artifact_name }}.7z" "${{ matrix.artifact_name }}/"
# Compress to artifact.001.vvpp,artifact.002.vvpp, ...
(cd "${{ matrix.artifact_name }}" && zip -r - . > ../compressed.zip)
split -b 2G --numeric-suffixes=1 -a 3 --additional-suffix .vvpp ./compressed.zip ./${{ matrix.artifact_name }}.
# Rename to artifact.vvpp if there are only artifact.001.vvpp
if [ "$(ls ${{ matrix.artifact_name }}.*.vvpp | wc -l)" == 1 ]; then
mv ${{ matrix.artifact_name }}.001.vvpp ${{ matrix.artifact_name }}.vvpp
fi
# Output splitted archive list
ls ${{ matrix.artifact_name }}.7z.* > archives_7z.txt
mv archives_7z.txt "${{ matrix.artifact_name }}.7z.txt"
ls ${{ matrix.artifact_name }}*.vvpp > archives_vvpp.txt
mv archives_vvpp.txt "${{ matrix.artifact_name }}.vvpp.txt"
- name: Upload splitted archives to Release assets
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ github.event.inputs.prerelease }}
tag_name: ${{ env.VOICEVOX_ENGINE_VERSION }}
files: |-
${{ matrix.artifact_name }}.7z.*
${{ matrix.artifact_name }}*.vvpp
${{ matrix.artifact_name }}.vvpp.txt
target_commitish: ${{ github.sha }}
run-release-test-workflow:
if: (github.event.release.tag_name || github.event.inputs.version) != ''
needs: [upload-to-release]
uses: ./.github/workflows/release-test.yml
with:
version: ${{ github.event.release.tag_name || github.event.inputs.version }} # env.VOICEVOX_ENGINE_VERSIONが使えない
repo_url: ${{ format('{0}/{1}', github.server_url, github.repository) }} # このリポジトリのURL