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