From 4b691cf289f28ba1cc1c11069b6bc916f1040949 Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Thu, 21 Mar 2024 22:58:50 +0900 Subject: [PATCH 01/18] =?UTF-8?q?Add:=20Java=20API=E3=81=AEPC=E7=94=A8?= =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_deploy.yml | 92 ++++++++++++------- crates/voicevox_core_java_api/README.md | 4 +- .../voicevox_core_java_api/lib/build.gradle | 2 +- 3 files changed, 60 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 263e287f9..bc0d25e0c 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -239,11 +239,10 @@ jobs: repository: VOICEVOX/voicevox_resource ref: ${{ env.VOICEVOX_RESOURCE_VERSION }} path: download/resource - - name: Raplace resource + - name: Replace resource if: inputs.is_production shell: bash - run: - mv -f download/resource/core/README.md ./README.md + run: mv -f download/resource/core/README.md ./README.md - name: Install cargo-binstall uses: taiki-e/install-action@cargo-binstall - name: Install cargo-edit @@ -289,7 +288,7 @@ jobs: env: ORT_USE_CUDA: ${{ matrix.use_cuda }} - name: build voicevox_core_java_api - if: contains(matrix.target, 'android') + if: "!contains(matrix.target, 'ios')" run: | function build() { cargo build -p voicevox_core_java_api -vv --features ${{ matrix.features }}, --target ${{ matrix.target }} --release @@ -315,8 +314,7 @@ jobs: cp -v target/${{ matrix.target }}/release/libvoicevox_core_java_api.so java_artifact/ || true - name: Code signing (Windows) if: startsWith(matrix.os, 'windows') && inputs.code_signing - run: - bash build_util/codesign.bash "artifact/${{ env.ASSET_NAME }}/voicevox_core.dll" + run: bash build_util/codesign.bash "artifact/${{ env.ASSET_NAME }}/voicevox_core.dll" env: ESIGNERCKA_USERNAME: ${{ secrets.ESIGNERCKA_USERNAME }} ESIGNERCKA_PASSWORD: ${{ secrets.ESIGNERCKA_PASSWORD }} @@ -350,7 +348,7 @@ jobs: ${{ steps.build-voicevox-core-python-api.outputs.whl }} target_commitish: ${{ github.sha }} - name: Upload voicevox_core_java_api artifact - if: fromJson(needs.config.outputs.deploy) && contains(matrix.target, 'android') + if: fromJson(needs.config.outputs.deploy) && !contains(matrix.target, 'ios') uses: actions/upload-artifact@v3 with: name: voicevox_core_java_api-${{ matrix.artifact_name }} @@ -380,10 +378,10 @@ jobs: name: voicevox_core-aarch64-apple-ios path: ${{ env.IOS_AARCH64_PATH }} - name: Create xcframework - id: create-xcframework + id: create-xcframework run: | build_util/make_ios_xcframework.bash - echo "output_asset_path=${OUTPUT_ASSET_PATH}" >> "$GITHUB_OUTPUT" + echo "output_asset_path=${OUTPUT_ASSET_PATH}" >> "$GITHUB_OUTPUT" env: OUTPUT_ASSET_PATH: artifact/voicevox_core-ios-xcframework-cpu - name: Archive artifact @@ -414,11 +412,10 @@ jobs: repository: VOICEVOX/voicevox_fat_resource ref: ${{ env.VOICEVOX_FAT_RESOURCE_VERSION }} path: download/fat_resource - - name: Raplace resource + - name: Replace resource if: inputs.is_production shell: bash - run: - rm -r ./model; mv download/fat_resource/core/model ./model + run: rm -r ./model; mv download/fat_resource/core/model ./model - name: Create artifact run: | mkdir "artifact" @@ -459,40 +456,65 @@ jobs: - name: Install cargo-edit run: cargo binstall cargo-edit@^0.11 --no-confirm - name: set cargo version - run: - cargo set-version "$VERSION" -p voicevox_core_java_api - - - name: "Download artifact (android-arm64-cpu)" - uses: actions/download-artifact@v3 - with: - name: voicevox_core_java_api-android-arm64-cpu - path: artifact/android-arm64-cpu + run: cargo set-version "$VERSION" -p voicevox_core_java_api - - name: "Download artifact (android-x86_64-cpu)" - uses: actions/download-artifact@v3 + - name: "Download artifact" + uses: actions/download-artifact@v4 with: - name: voicevox_core_java_api-android-x86_64-cpu - path: artifact/android-x86_64-cpu + name: voicevox_core_java_api-* + path: artifacts/ - name: Print tree - run: tree artifact + run: tree artifacts - - name: Build voicevoxcore-android + - name: Build voicevoxcore run: | - rm -rf crates/voicevox_core_java_api/lib/src/main/resources/dll - cat < $1/$target" + done + } + + # desktop: cpu + setup_dll dll < Date: Thu, 21 Mar 2024 23:03:32 +0900 Subject: [PATCH 02/18] =?UTF-8?q?Change:=20artifact=E7=B3=BB=E3=82=92v4?= =?UTF-8?q?=E3=81=AB=E6=8F=83=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_deploy.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index bc0d25e0c..0ffc5d56d 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -321,7 +321,7 @@ jobs: ESIGNERCKA_TOTP_SECRET: ${{ secrets.ESIGNERCKA_TOTP_SECRET }} - name: Upload artifact to build XCFramework if: contains(matrix.target, 'ios') - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: voicevox_core-${{ matrix.target }} path: artifact/${{ env.ASSET_NAME }} @@ -349,7 +349,7 @@ jobs: target_commitish: ${{ github.sha }} - name: Upload voicevox_core_java_api artifact if: fromJson(needs.config.outputs.deploy) && !contains(matrix.target, 'ios') - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: voicevox_core_java_api-${{ matrix.artifact_name }} path: java_artifact @@ -365,15 +365,15 @@ jobs: ASSET_NAME: voicevox_core-ios-xcframework-cpu-${{ needs.config.outputs.version }} steps: - uses: actions/checkout@v3 - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: voicevox_core-x86_64-apple-ios path: ${{ env.IOS_X86_64_PATH }} - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: voicevox_core-aarch64-apple-ios-sim path: ${{ env.IOS_AARCH64_SIM_PATH }} - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: voicevox_core-aarch64-apple-ios path: ${{ env.IOS_AARCH64_PATH }} From a2a6ac6cba8625bc1cdc78abea092b95bc8dfd22 Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Sat, 23 Mar 2024 21:32:17 +0900 Subject: [PATCH 03/18] Fix: name -> pattern --- .github/workflows/build_and_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 0ffc5d56d..58fab88a3 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -461,7 +461,7 @@ jobs: - name: "Download artifact" uses: actions/download-artifact@v4 with: - name: voicevox_core_java_api-* + pattern: voicevox_core_java_api-* path: artifacts/ - name: Print tree From 1dfa267afa64888905cec8b522624f0fc94e7b8d Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Sat, 23 Mar 2024 22:34:19 +0900 Subject: [PATCH 04/18] =?UTF-8?q?Fix:=20cwd=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [skip ci] --- .github/workflows/build_and_deploy.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 58fab88a3..1fe5c4012 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -469,15 +469,16 @@ jobs: - name: Build voicevoxcore run: | + cd crates/voicevox_core_java_api function setup_dll() { rm -rf crates/voicevox_core_java_api/lib/src/main/resources/dll rm -rf crates/voicevox_core_java_api/lib/src/main/resources/jniLibs while IFS= read -r line; do IFS=' ' read -r artifact_name target <<< "$line" mkdir -p crates/voicevox_core_java_api/lib/src/main/resources/$1/$target - cp -v artifacts/voicevox_core_java_api-$artifact_name/*.dll crates/voicevox_core_java_api/lib/src/main/resources/$1/$target/ || true - cp -v artifacts/voicevox_core_java_api-$artifact_name/*.so crates/voicevox_core_java_api/lib/src/main/resources/$1/$target/ || true - cp -v artifacts/voicevox_core_java_api-$artifact_name/*.dylib crates/voicevox_core_java_api/lib/src/main/resources/$1/$target/ || true + cp -v artifacts/voicevox_core_java_api-$artifact_name/*.dll lib/src/main/resources/$1/$target/ || true + cp -v artifacts/voicevox_core_java_api-$artifact_name/*.so lib/src/main/resources/$1/$target/ || true + cp -v artifacts/voicevox_core_java_api-$artifact_name/*.dylib lib/src/main/resources/$1/$target/ || true echo "$artifact_name => $1/$target" done } @@ -512,8 +513,8 @@ jobs: android-x86_64-cpu x86_64 EOF - cp ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so crates/voicevox_core_java_api/lib/src/main/resources/jniLibs/arm64-v8a/ - cp ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/libc++_shared.so crates/voicevox_core_java_api/lib/src/main/resources/jniLibs/x86_64/ + cp ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so lib/src/main/resources/jniLibs/arm64-v8a/ + cp ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/libc++_shared.so lib/src/main/resources/jniLibs/x86_64/ OS=android DEVICE=cpu gradle publishToMavenLocal From 05fbb496665125d18053aff6d4aa4fd3f5b3bb21 Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Sat, 23 Mar 2024 22:48:00 +0900 Subject: [PATCH 05/18] =?UTF-8?q?Fix:=20=E3=83=91=E3=82=B9=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [skip ci] --- .github/workflows/build_and_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 1fe5c4012..aa360a24f 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -311,7 +311,7 @@ jobs: echo "${{ env.VERSION }}" > "artifact/${{ env.ASSET_NAME }}/VERSION" mkdir java_artifact - cp -v target/${{ matrix.target }}/release/libvoicevox_core_java_api.so java_artifact/ || true + cp -v target/${{ matrix.target }}/release/*voicevox_core_java_api.{dll,so,dylib} "java_artifact" || true - name: Code signing (Windows) if: startsWith(matrix.os, 'windows') && inputs.code_signing run: bash build_util/codesign.bash "artifact/${{ env.ASSET_NAME }}/voicevox_core.dll" From f862b0d80bdff4b9502427124a0f82bf8cfe15d0 Mon Sep 17 00:00:00 2001 From: Nanashi Date: Sat, 23 Mar 2024 23:01:22 +0900 Subject: [PATCH 06/18] =?UTF-8?q?Fix:=20=E3=83=91=E3=82=B9=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_deploy.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index aa360a24f..d26bb8493 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -471,14 +471,12 @@ jobs: run: | cd crates/voicevox_core_java_api function setup_dll() { - rm -rf crates/voicevox_core_java_api/lib/src/main/resources/dll - rm -rf crates/voicevox_core_java_api/lib/src/main/resources/jniLibs + rm -rf lib/src/main/resources/dll + rm -rf lib/src/main/resources/jniLibs while IFS= read -r line; do IFS=' ' read -r artifact_name target <<< "$line" - mkdir -p crates/voicevox_core_java_api/lib/src/main/resources/$1/$target - cp -v artifacts/voicevox_core_java_api-$artifact_name/*.dll lib/src/main/resources/$1/$target/ || true - cp -v artifacts/voicevox_core_java_api-$artifact_name/*.so lib/src/main/resources/$1/$target/ || true - cp -v artifacts/voicevox_core_java_api-$artifact_name/*.dylib lib/src/main/resources/$1/$target/ || true + mkdir -p lib/src/main/resources/$1/$target + cp -v ../../artifacts/voicevox_core_java_api-$artifact_name/*.{dll,so,dylib} lib/src/main/resources/$1/$target/ || true echo "$artifact_name => $1/$target" done } From 86c0ee55aa367e8455df9d142161cc8df88332dc Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Sun, 24 Mar 2024 00:03:34 +0900 Subject: [PATCH 07/18] =?UTF-8?q?Change:=20directml=E3=81=A8cuda=E3=81=A7?= =?UTF-8?q?=E5=88=86=E3=81=91=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_deploy.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index d26bb8493..2a160ce45 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -493,9 +493,9 @@ jobs: OS=desktop DEVICE=cpu gradle publishToMavenLocal - # desktop: gpu + # desktop: cuda setup_dll dll < Date: Mon, 25 Mar 2024 20:20:42 +0900 Subject: [PATCH 08/18] =?UTF-8?q?Fix:=20DEVICE=E5=91=A8=E3=82=8A=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/voicevox_core_java_api/README.md | 4 ++-- crates/voicevox_core_java_api/lib/build.gradle | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/voicevox_core_java_api/README.md b/crates/voicevox_core_java_api/README.md index 02fc3bc9a..ab5ef5064 100644 --- a/crates/voicevox_core_java_api/README.md +++ b/crates/voicevox_core_java_api/README.md @@ -53,7 +53,7 @@ Java プロジェクトを動かすには、 # または ❯ cp ../../target/debug/libvoicevox_core_java_api.so lib/src/main/resources/dll/[target]/libvoicevox_core_java_api.so ❯ ./gradlew test -❯ DEVICE=gpu ./gradlew test +❯ DEVICE=cuda ./gradlew test ❯ OS=android ./gradlew test ``` @@ -67,7 +67,7 @@ Java プロジェクトを動かすには、 ❯ cargo build --release ❯ cp ../../target/release/libvoicevox_core_java_api.so lib/src/main/resources/dll/[target]/libvoicevox_core_java_api.so ❯ ./gradlew build -❯ DEVICE=gpu ./gradlew build +❯ DEVICE=cuda ./gradlew build ❯ OS=android ./gradlew build ``` diff --git a/crates/voicevox_core_java_api/lib/build.gradle b/crates/voicevox_core_java_api/lib/build.gradle index 0c92ce4b1..201a9eb78 100644 --- a/crates/voicevox_core_java_api/lib/build.gradle +++ b/crates/voicevox_core_java_api/lib/build.gradle @@ -12,7 +12,7 @@ plugins { id "com.diffplug.spotless" version "6.20.0" } -def boolean isGpu = gradle.ext.targetDevice == 'gpu' +def boolean isGpu = ["directml", "cuda"].contains(gradle.ext.targetDevice) version = gradle.ext.version From 223d7227cea83807c165dce368f6ada86fa1b976 Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Mon, 25 Mar 2024 22:44:03 +0900 Subject: [PATCH 09/18] =?UTF-8?q?Fix:=20actionlint=E3=81=AB=E3=81=B2?= =?UTF-8?q?=E3=81=A3=E3=81=8B=E3=81=8B=E3=81=A3=E3=81=A6=E3=81=9F=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 2a160ce45..530b8d716 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -475,8 +475,8 @@ jobs: rm -rf lib/src/main/resources/jniLibs while IFS= read -r line; do IFS=' ' read -r artifact_name target <<< "$line" - mkdir -p lib/src/main/resources/$1/$target - cp -v ../../artifacts/voicevox_core_java_api-$artifact_name/*.{dll,so,dylib} lib/src/main/resources/$1/$target/ || true + mkdir -p "lib/src/main/resources/$1/$target" + cp -v "../../artifacts/voicevox_core_java_api-$artifact_name"/*.{dll,so,dylib} "lib/src/main/resources/$1/$target/" || true echo "$artifact_name => $1/$target" done } From ba545faa776d3fcdc53b8fef33269f0d5546e48e Mon Sep 17 00:00:00 2001 From: Nanashi Date: Sat, 30 Mar 2024 14:15:22 +0900 Subject: [PATCH 10/18] =?UTF-8?q?Fix:=20=E5=90=A6=E5=AE=9A=E3=81=AE?= =?UTF-8?q?=E8=A1=A8=E8=A8=98=E3=82=92${{=20}}=E3=81=AE=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Hiroshiba --- .github/workflows/build_and_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 530b8d716..6fd88bd10 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -288,7 +288,7 @@ jobs: env: ORT_USE_CUDA: ${{ matrix.use_cuda }} - name: build voicevox_core_java_api - if: "!contains(matrix.target, 'ios')" + if: ${{ !contains(matrix.target, 'ios') }} run: | function build() { cargo build -p voicevox_core_java_api -vv --features ${{ matrix.features }}, --target ${{ matrix.target }} --release From c8086aba2887068240e9f690df342ef34b6f3c16 Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Sat, 30 Mar 2024 20:40:18 +0900 Subject: [PATCH 11/18] =?UTF-8?q?Change:=20setup=5Fdll=E3=82=92=E8=A7=A3?= =?UTF-8?q?=E4=BD=93=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_deploy.yml | 69 +++++++++++++------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 6fd88bd10..6faf86c35 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -470,58 +470,57 @@ jobs: - name: Build voicevoxcore run: | cd crates/voicevox_core_java_api - function setup_dll() { + function copy_dll() { + artifact_name=$1 + target=$2 + root=$(echo $1 | grep -q android && echo jniLibs || echo dll) + dest="lib/src/main/resources/$root/$target" + mkdir -p $dest + cp -v "../../artifacts/voicevox_core_java_api-$artifact_name"/*.{dll,so,dylib} $dest + echo "$artifact_name => $dest" + } + function clean_dlls() { rm -rf lib/src/main/resources/dll rm -rf lib/src/main/resources/jniLibs - while IFS= read -r line; do - IFS=' ' read -r artifact_name target <<< "$line" - mkdir -p "lib/src/main/resources/$1/$target" - cp -v "../../artifacts/voicevox_core_java_api-$artifact_name"/*.{dll,so,dylib} "lib/src/main/resources/$1/$target/" || true - echo "$artifact_name => $1/$target" - done } # desktop: cpu - setup_dll dll < Date: Sat, 30 Mar 2024 20:48:31 +0900 Subject: [PATCH 12/18] =?UTF-8?q?Fix:=20shellcheck=E3=81=AB=E5=BC=95?= =?UTF-8?q?=E3=81=A3=E3=81=8B=E3=81=8B=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=82=92=E7=9B=B4=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 6faf86c35..c4f8871b9 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -473,10 +473,10 @@ jobs: function copy_dll() { artifact_name=$1 target=$2 - root=$(echo $1 | grep -q android && echo jniLibs || echo dll) + root=$(echo "$1" | grep -q android && echo jniLibs || echo dll) dest="lib/src/main/resources/$root/$target" - mkdir -p $dest - cp -v "../../artifacts/voicevox_core_java_api-$artifact_name"/*.{dll,so,dylib} $dest + mkdir -p "$dest" + cp -v "../../artifacts/voicevox_core_java_api-$artifact_name"/*.{dll,so,dylib} "$dest" echo "$artifact_name => $dest" } function clean_dlls() { From da8cf4db913333781a2e84e57bc73343f0dd1782 Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Sun, 31 Mar 2024 00:42:40 +0900 Subject: [PATCH 13/18] =?UTF-8?q?Add:=20=E3=83=81=E3=82=A7=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_deploy.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index c4f8871b9..6f147e826 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -476,8 +476,15 @@ jobs: root=$(echo "$1" | grep -q android && echo jniLibs || echo dll) dest="lib/src/main/resources/$root/$target" mkdir -p "$dest" - cp -v "../../artifacts/voicevox_core_java_api-$artifact_name"/*.{dll,so,dylib} "$dest" - echo "$artifact_name => $dest" + cp -v "../../artifacts/voicevox_core_java_api-$artifact_name"/*.{dll,so,dylib} "$dest" || true + # こうするしかないはず。echoを使わない書き方があるかもしれないが、シンプルに面倒。 + # shellcheck disable=SC2086 + if [ "$(echo $dest/*)" = "$dest/*" ]; then + echo "No dll found in $artifact_name" + exit 1 + else + echo "$artifact_name => $dest" + fi } function clean_dlls() { rm -rf lib/src/main/resources/dll From 29883a800370e9504a9148a4d3cac815a000e1db Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Sun, 31 Mar 2024 01:02:35 +0900 Subject: [PATCH 14/18] =?UTF-8?q?Fix:=20-cuda=E3=81=98=E3=82=83=E3=81=AA?= =?UTF-8?q?=E3=81=8F-gpu=E3=81=A0=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 6f147e826..b907a3347 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -506,7 +506,7 @@ jobs: clean_dlls copy_dll windows-x64-cuda windows-x64 copy_dll windows-x86-cpu windows-x86 - copy_dll linux-x64-cuda linux-x64 + copy_dll linux-x64-gpu linux-x64 copy_dll linux-arm64-cpu linux-arm64 copy_dll osx-x64-cpu macos-x64 copy_dll osx-arm64-cpu macos-arm64 From 2966c1facbed0e2a1326944fd4d25369ad25b881 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Mon, 15 Apr 2024 02:02:05 +0900 Subject: [PATCH 15/18] Apply suggestions from code review --- crates/voicevox_core_java_api/lib/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/voicevox_core_java_api/lib/build.gradle b/crates/voicevox_core_java_api/lib/build.gradle index 201a9eb78..06ceaeb14 100644 --- a/crates/voicevox_core_java_api/lib/build.gradle +++ b/crates/voicevox_core_java_api/lib/build.gradle @@ -12,7 +12,7 @@ plugins { id "com.diffplug.spotless" version "6.20.0" } -def boolean isGpu = ["directml", "cuda"].contains(gradle.ext.targetDevice) +def boolean isGpu = ['cuda', 'directml'].contains(gradle.ext.targetDevice) version = gradle.ext.version From 2a9f8af37b6ab47e73e3ce5f4f154e394080588c Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Wed, 17 Apr 2024 19:16:59 +0900 Subject: [PATCH 16/18] =?UTF-8?q?Change:=20case=E3=81=A7=E6=9B=B8=E3=81=8D?= =?UTF-8?q?=E3=81=8B=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_deploy.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index b907a3347..136fe9a8b 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -475,16 +475,17 @@ jobs: target=$2 root=$(echo "$1" | grep -q android && echo jniLibs || echo dll) dest="lib/src/main/resources/$root/$target" - mkdir -p "$dest" - cp -v "../../artifacts/voicevox_core_java_api-$artifact_name"/*.{dll,so,dylib} "$dest" || true - # こうするしかないはず。echoを使わない書き方があるかもしれないが、シンプルに面倒。 - # shellcheck disable=SC2086 - if [ "$(echo $dest/*)" = "$dest/*" ]; then - echo "No dll found in $artifact_name" - exit 1 - else - echo "$artifact_name => $dest" - fi + mkdir -p "$artifact_name" + case "$target" in + windows-*) ext=dll ;; + osx-*) ext=dylib ;; + linux-*) ext=so ;; + android-*) ext=so ;; + *) echo "unknown target: $target"; exit 1 ;; + esac + + cp -v "../../artifacts/voicevox_core_java_api-$artifact_name"/*."$ext" "$dest" + echo "$artifact_name => $dest" } function clean_dlls() { rm -rf lib/src/main/resources/dll From cb1ae01e08dca65e99591d526bf2450f02c69dc1 Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Wed, 17 Apr 2024 19:43:18 +0900 Subject: [PATCH 17/18] =?UTF-8?q?Fix:=20mkdir=E5=BF=98=E3=82=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_deploy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 136fe9a8b..0a64d0d4e 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -475,7 +475,6 @@ jobs: target=$2 root=$(echo "$1" | grep -q android && echo jniLibs || echo dll) dest="lib/src/main/resources/$root/$target" - mkdir -p "$artifact_name" case "$target" in windows-*) ext=dll ;; osx-*) ext=dylib ;; @@ -484,8 +483,8 @@ jobs: *) echo "unknown target: $target"; exit 1 ;; esac + mkdir -p "$dest" cp -v "../../artifacts/voicevox_core_java_api-$artifact_name"/*."$ext" "$dest" - echo "$artifact_name => $dest" } function clean_dlls() { rm -rf lib/src/main/resources/dll From 8d5633b6642361ff48ffaa63c0e5e90b3fc2fe32 Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Wed, 17 Apr 2024 20:03:54 +0900 Subject: [PATCH 18/18] =?UTF-8?q?Fix:=20target=E3=81=98=E3=82=83=E3=81=AA?= =?UTF-8?q?=E3=81=8F=E3=81=A6artifact=5Fname=E3=81=A0=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 0a64d0d4e..caabb9d78 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -475,7 +475,7 @@ jobs: target=$2 root=$(echo "$1" | grep -q android && echo jniLibs || echo dll) dest="lib/src/main/resources/$root/$target" - case "$target" in + case "$artifact_name" in windows-*) ext=dll ;; osx-*) ext=dylib ;; linux-*) ext=so ;;