From 2a9f8af37b6ab47e73e3ce5f4f154e394080588c Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Wed, 17 Apr 2024 19:16:59 +0900 Subject: [PATCH] =?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