19
19
code_signing :
20
20
description : " コード署名する"
21
21
type : boolean
22
+ upload_artifact :
23
+ description : " デバッグ用に成果物をartifactにアップロードするか"
24
+ type : boolean
25
+ default : false
22
26
23
27
env :
24
28
VOICEVOX_ENGINE_REPO_URL : " https://github.com/VOICEVOX/voicevox_engine"
29
33
${{ github.event.release.tag_name || github.event.inputs.version || '999.999.999' }}
30
34
31
35
jobs :
32
- build :
36
+ build-and-upload :
33
37
environment : ${{ github.event.inputs.code_signing == 'true' && 'code_signing' || '' }} # コード署名用のenvironment(false時の挙動は2022年7月10日時点で未定義動作)
34
38
env :
35
39
ELECTRON_CACHE : .cache/electron
56
60
installer_artifact_name : linux-nvidia-appimage
57
61
linux_artifact_name : " VOICEVOX.${ext}"
58
62
linux_executable_name : voicevox
63
+ linux_appimage_7z_name : VOICEVOX.AppImage
59
64
sed_name : sed
60
65
os : ubuntu-20.04
61
66
# Linux CPU
68
73
installer_artifact_name : linux-cpu-appimage
69
74
linux_artifact_name : " VOICEVOX.${ext}"
70
75
linux_executable_name : voicevox
76
+ linux_appimage_7z_name : VOICEVOX-CPU.AppImage
71
77
sed_name : sed
72
78
os : ubuntu-20.04
73
79
# Windows CUDA
@@ -359,8 +365,8 @@ jobs:
359
365
shell : bash
360
366
run : mkdir -p prepackage/VOICEVOX.app/Contents/Resources/ja.lproj prepackage/VOICEVOX.app/Contents/Resources/en.lproj
361
367
362
- - name : Create Linux tar.gz
363
- if : startsWith(matrix.artifact_name, 'linux-')
368
+ - name : Create Linux tar.gz (without nvidia)
369
+ if : startsWith(matrix.artifact_name, 'linux-') && !contains(matrix.artifact_name, 'nvidia')
364
370
shell : bash
365
371
run : |
366
372
name="${{ matrix.compressed_artifact_name }}-${{ env.VOICEVOX_EDITOR_VERSION }}"
@@ -369,27 +375,51 @@ jobs:
369
375
7z a -tgzip $name.tar.gz $name.tar
370
376
rm $name.tar
371
377
372
- - name : Upload Linux tar.gz artifact
373
- if : startsWith(matrix.artifact_name, 'linux-')
374
- uses : actions/upload-artifact@v3
378
+ - name : Upload Linux tar.gz (without nvidia)
379
+ if : startsWith(matrix.artifact_name, 'linux-') && !contains(matrix.artifact_name, 'nvidia')
380
+ uses : ./.github/ actions/upload-release-and- artifact
375
381
with :
376
- name : ${{ matrix.artifact_name }}-targz
377
- path : " ${{ matrix.compressed_artifact_name }}-${{ env.VOICEVOX_EDITOR_VERSION }}.tar.gz"
382
+ files : |-
383
+ ${{ matrix.compressed_artifact_name }}-${{ env.VOICEVOX_EDITOR_VERSION }}.tar.gz
384
+ upload_release : ${{ (github.event.release.tag_name || github.event.inputs.version) != '' }}
385
+ upload_artifact : ${{ github.event.inputs.upload_artifact }}
386
+ prerelease : ${{ github.event.inputs.prerelease }}
387
+ tag_name : ${{ env.VOICEVOX_EDITOR_VERSION }}
388
+ target_commitish : ${{ github.sha }}
389
+ artifact_name : ${{ matrix.artifact_name }}-targz
378
390
379
- - name : Create Windows & Mac zip
380
- if : startsWith(matrix.artifact_name, 'windows-') || startsWith(matrix.artifact_name, 'macos-')
391
+ - name : Delete Linux tar.gz (without nvidia)
392
+ if : startsWith(matrix.artifact_name, 'linux-') && !contains(matrix.artifact_name, 'nvidia')
393
+ shell : bash
394
+ run : |
395
+ rm ${{ matrix.compressed_artifact_name }}-${{ env.VOICEVOX_EDITOR_VERSION }}.tar.gz
396
+
397
+ - name : Create Windows & Mac zip (without nvidia)
398
+ if : (startsWith(matrix.artifact_name, 'windows-') || startsWith(matrix.artifact_name, 'macos-')) && !contains(matrix.artifact_name, 'nvidia')
381
399
shell : bash
382
400
run : |
383
401
name="${{ matrix.compressed_artifact_name }}-${{ env.VOICEVOX_EDITOR_VERSION }}"
384
402
7z a -tzip $name.zip prepackage/
385
403
7z rn $name.zip prepackage/ VOICEVOX/
386
404
387
- - name : Upload Windows & Mac zip artifact
388
- if : startsWith(matrix.artifact_name, 'windows-') || startsWith(matrix.artifact_name, 'macos-')
389
- uses : actions/upload-artifact@v3
405
+ - name : Upload Windows & Mac zip (without nvidia)
406
+ if : ( startsWith(matrix.artifact_name, 'windows-') || startsWith(matrix.artifact_name, 'macos-')) && !contains(matrix.artifact_name, 'nvidia ')
407
+ uses : ./.github/ actions/upload-release-and- artifact
390
408
with :
391
- name : ${{ matrix.artifact_name }}-zip
392
- path : " ${{ matrix.compressed_artifact_name }}-${{ env.VOICEVOX_EDITOR_VERSION }}.zip"
409
+ files : |-
410
+ ${{ matrix.compressed_artifact_name }}-${{ env.VOICEVOX_EDITOR_VERSION }}.zip
411
+ upload_release : ${{ (github.event.release.tag_name || github.event.inputs.version) != '' }}
412
+ upload_artifact : ${{ github.event.inputs.upload_artifact }}
413
+ prerelease : ${{ github.event.inputs.prerelease }}
414
+ tag_name : ${{ env.VOICEVOX_EDITOR_VERSION }}
415
+ target_commitish : ${{ github.sha }}
416
+ artifact_name : ${{ matrix.artifact_name }}-zip
417
+
418
+ - name : Delete Windows & Mac zip (without nvidia)
419
+ if : (startsWith(matrix.artifact_name, 'windows-') || startsWith(matrix.artifact_name, 'macos-')) && !contains(matrix.artifact_name, 'nvidia')
420
+ shell : bash
421
+ run : |
422
+ rm ${{ matrix.compressed_artifact_name }}-${{ env.VOICEVOX_EDITOR_VERSION }}.zip
393
423
394
424
- name : Show disk space (debug info)
395
425
shell : bash
@@ -440,21 +470,53 @@ jobs:
440
470
run : |
441
471
df -h
442
472
443
- - name : Upload Linux AppImage artifact
473
+ - name : Create Linux AppImage split
474
+ if : endsWith(matrix.installer_artifact_name, '-appimage')
475
+ shell : bash
476
+ run : |
477
+ cd dist_electron/
478
+
479
+ for appImageFile in *.AppImage; do
480
+ echo "Splitting ${appImageFile}"
481
+
482
+ # compressed to MyArtifact.AppImage.7z.001, MyArtifact.AppImage.7z.002, ...
483
+ 7z -v1g a "${{ matrix.linux_appimage_7z_name }}.7z" "${appImageFile}"
484
+
485
+ # Output split archive name<TAB>size<TAB>hash list to myartifact.7z.txt
486
+ ls "${{ matrix.linux_appimage_7z_name }}.7z".* > archives_name.txt
487
+ stat --printf="%s\n" "${{ matrix.linux_appimage_7z_name }}.7z".* > archives_size.txt
488
+ md5sum "${{ matrix.linux_appimage_7z_name }}.7z".* | awk '{print $1}' | tr a-z A-Z > archives_hash.txt
489
+
490
+ paste -d '\t' archives_name.txt archives_size.txt archives_hash.txt > archives.txt
491
+
492
+ mv archives.txt "${{ matrix.installer_artifact_name }}.7z.txt"
493
+ done
494
+
495
+ - name : Upload Linux AppImage split
444
496
if : endsWith(matrix.installer_artifact_name, '-appimage')
445
- uses : actions/upload-artifact@v3
497
+ uses : ./.github/ actions/upload-release-and- artifact
446
498
with :
447
- name : ${{ matrix.installer_artifact_name }}
448
- path : |
449
- dist_electron/*.AppImage
499
+ files : |-
500
+ dist_electron/*.7z.*
501
+ upload_release : ${{ (github.event.release.tag_name || github.event.inputs.version) != '' }}
502
+ upload_artifact : ${{ github.event.inputs.upload_artifact }}
503
+ prerelease : ${{ github.event.inputs.prerelease }}
504
+ tag_name : ${{ env.VOICEVOX_EDITOR_VERSION }}
505
+ target_commitish : ${{ github.sha }}
506
+ artifact_name : ${{ matrix.installer_artifact_name }}-release
450
507
451
- - name : Upload macOS dmg artifact
508
+ - name : Upload macOS dmg
452
509
if : endsWith(matrix.installer_artifact_name, '-dmg')
453
- uses : actions/upload-artifact@v3
510
+ uses : ./.github/ actions/upload-release-and- artifact
454
511
with :
455
- name : ${{ matrix.installer_artifact_name }}
456
- path : |
512
+ files : |-
457
513
dist_electron/*.dmg
514
+ upload_release : ${{ (github.event.release.tag_name || github.event.inputs.version) != '' }}
515
+ upload_artifact : ${{ github.event.inputs.upload_artifact }}
516
+ prerelease : ${{ github.event.inputs.prerelease }}
517
+ tag_name : ${{ env.VOICEVOX_EDITOR_VERSION }}
518
+ target_commitish : ${{ github.sha }}
519
+ artifact_name : ${{ matrix.installer_artifact_name }}
458
520
459
521
- name : Create Windows NSIS Web artifact directory
460
522
if : endsWith(matrix.installer_artifact_name, '-nsis-web')
@@ -475,150 +537,16 @@ jobs:
475
537
NEW_NAME=${OLD_NAME// /.}
476
538
mv "${OLD_NAME}" $NEW_NAME
477
539
478
- - name : Upload Windows NSIS Web artifact
540
+ - name : Upload Windows NSIS Web
479
541
if : endsWith(matrix.installer_artifact_name, '-nsis-web')
480
- uses : actions/upload-artifact@v3
481
- with :
482
- name : ${{ matrix.installer_artifact_name }}
483
- path : |
484
- nsis-web-artifact/*
485
-
486
- upload-distributable-to-release :
487
- if : (github.event.release.tag_name || github.event.inputs.version) != '' # If release
488
- needs : [build]
489
- strategy :
490
- fail-fast : false
491
- matrix :
492
- os : [ubuntu-20.04]
493
- artifact_name :
494
- - linux-nvidia-appimage
495
- - linux-cpu-appimage
496
- - linux-nvidia-prepackage-targz
497
- - linux-cpu-prepackage-targz
498
- - windows-nvidia-nsis-web
499
- - windows-cpu-nsis-web
500
- - windows-directml-nsis-web
501
- - windows-nvidia-prepackage-zip
502
- - windows-cpu-prepackage-zip
503
- - windows-directml-prepackage-zip
504
- - macos-cpu-dmg
505
- - macos-cpu-prepackage-zip
506
- include :
507
- - artifact_name : linux-nvidia-appimage
508
- appimage_7z_name : VOICEVOX.AppImage
509
- - artifact_name : linux-cpu-appimage
510
- appimage_7z_name : VOICEVOX-CPU.AppImage
511
-
512
- runs-on : ${{ matrix.os }}
513
- steps :
514
- - uses : actions/checkout@v3
515
-
516
- - name : Download and extract distributable artifact
517
- uses : actions/download-artifact@v3
542
+ uses : ./.github/actions/upload-release-and-artifact
518
543
with :
519
- name : ${{ matrix.artifact_name }}
520
- path : ./artifact
521
-
522
- - name : Show disk space (debug info)
523
- shell : bash
524
- run : |
525
- df -h
526
-
527
- # Linux AppImage
528
- - name : Install dependencies for Linux AppImage Upload
529
- if : endsWith(matrix.artifact_name, '-appimage')
530
- shell : bash
531
- run : |
532
- sudo apt-get update
533
- sudo apt-get install -y p7zip-full
534
-
535
- - name : Split AppImage artifact
536
- if : endsWith(matrix.artifact_name, '-appimage')
537
- shell : bash
538
- run : |
539
- cd artifact/
540
-
541
- for appImageFile in *.AppImage; do
542
- echo "Splitting ${appImageFile}"
543
-
544
- # compressed to MyArtifact.AppImage.7z.001, MyArtifact.AppImage.7z.002, ...
545
- 7z -v1g a "${{ matrix.appimage_7z_name }}.7z" "${appImageFile}"
546
-
547
- # Output splitted archive name<TAB>size<TAB>hash list to myartifact.7z.txt
548
- ls "${{ matrix.appimage_7z_name }}.7z".* > archives_name.txt
549
- stat --printf="%s\n" "${{ matrix.appimage_7z_name }}.7z".* > archives_size.txt
550
- md5sum "${{ matrix.appimage_7z_name }}.7z".* | awk '{print $1}' | tr a-z A-Z > archives_hash.txt
551
-
552
- paste -d '\t' archives_name.txt archives_size.txt archives_hash.txt > archives.txt
553
-
554
- mv archives.txt "${{ matrix.artifact_name }}.7z.txt"
555
- done
556
-
557
- - name : Show disk space (debug info)
558
- if : endsWith(matrix.artifact_name, '-appimage')
559
- shell : bash
560
- run : |
561
- df -h
562
-
563
- - name : Upload Linux AppImage Release artifact
564
- if : endsWith(matrix.artifact_name, '-appimage')
565
- uses : actions/upload-artifact@v3
566
- with :
567
- name : ${{ matrix.artifact_name }}-release
568
- path : |
569
- artifact/*.7z.*
570
-
571
- - name : Upload Linux AppImage splitted archives to Release assets
572
- if : endsWith(matrix.artifact_name, '-appimage')
573
- uses : softprops/action-gh-release@v1
574
- with :
575
- prerelease : ${{ github.event.inputs.prerelease }}
576
- tag_name : ${{ env.VOICEVOX_EDITOR_VERSION }}
577
544
files : |-
578
- artifact/*.7z.*
579
- target_commitish : ${{ github.sha }}
580
-
581
- # Windows NSIS Web
582
- - name : Upload Windows nsis-web archives to Release assets
583
- if : endsWith(matrix.artifact_name, '-nsis-web')
584
- uses : softprops/action-gh-release@v1
585
- with :
545
+ nsis-web-artifact/*.7z.*
546
+ nsis-web-artifact/*.exe
547
+ upload_release : ${{ (github.event.release.tag_name || github.event.inputs.version) != '' }}
548
+ upload_artifact : ${{ github.event.inputs.upload_artifact }}
586
549
prerelease : ${{ github.event.inputs.prerelease }}
587
550
tag_name : ${{ env.VOICEVOX_EDITOR_VERSION }}
588
- files : |-
589
- artifact/*.7z.*
590
- artifact/*.exe
591
- target_commitish : ${{ github.sha }}
592
-
593
- # macOS dmg
594
- - name : Upload macOS dmg to Release assets
595
- if : endsWith(matrix.artifact_name, '-dmg')
596
- uses : softprops/action-gh-release@v1
597
- with :
598
- prerelease : ${{ github.event.inputs.prerelease }}
599
- tag_name : ${{ env.VOICEVOX_EDITOR_VERSION }}
600
- files : |-
601
- artifact/*.dmg
602
- target_commitish : ${{ github.sha }}
603
-
604
- # targz
605
- - name : Upload targz to Release assets
606
- if : endsWith(matrix.artifact_name, '-targz')
607
- uses : softprops/action-gh-release@v1
608
- with :
609
- prerelease : ${{ github.event.inputs.prerelease }}
610
- tag_name : ${{ env.VOICEVOX_EDITOR_VERSION }}
611
- files : |-
612
- artifact/*.tar.gz
613
- target_commitish : ${{ github.sha }}
614
-
615
- # zip
616
- - name : Upload zip to Release assets
617
- if : endsWith(matrix.artifact_name, '-zip')
618
- uses : softprops/action-gh-release@v1
619
- with :
620
- prerelease : ${{ github.event.inputs.prerelease }}
621
- tag_name : ${{ env.VOICEVOX_EDITOR_VERSION }}
622
- files : |-
623
- artifact/*.zip
624
551
target_commitish : ${{ github.sha }}
552
+ artifact_name : ${{ matrix.installer_artifact_name }}
0 commit comments