From a4af9c388faa87d5838f3893827efd187d32417d Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Tue, 7 Jan 2025 10:12:28 +0800 Subject: [PATCH] Add README for android libs. --- .github/scripts/test-nodejs-addon-npm.sh | 8 ++++---- .github/workflows/android.yaml | 4 ++++ .github/workflows/lazarus.yaml | 1 + build-android-arm64-v8a.sh | 16 ++++++++++++++++ build-android-armv7-eabi.sh | 17 +++++++++++++++++ build-android-x86-64.sh | 17 +++++++++++++++++ build-android-x86.sh | 17 +++++++++++++++++ 7 files changed, 76 insertions(+), 4 deletions(-) diff --git a/.github/scripts/test-nodejs-addon-npm.sh b/.github/scripts/test-nodejs-addon-npm.sh index d3e85f687..e2d8487be 100755 --- a/.github/scripts/test-nodejs-addon-npm.sh +++ b/.github/scripts/test-nodejs-addon-npm.sh @@ -85,19 +85,19 @@ fi echo "----------tts----------" -wget https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-en_US-ljspeech.tar.bz2 +curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-en_US-ljspeech.tar.bz2 tar xvf matcha-icefall-en_US-ljspeech.tar.bz2 rm matcha-icefall-en_US-ljspeech.tar.bz2 -wget https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx +curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx node ./test_tts_non_streaming_matcha_icefall_en.js rm hifigan_v2.onnx rm -rf matcha-icefall-en_US-ljspeech -wget https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-zh-baker.tar.bz2 +curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-zh-baker.tar.bz2 tar xvf matcha-icefall-zh-baker.tar.bz2 rm matcha-icefall-zh-baker.tar.bz2 -wget https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx +curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/hifigan_v2.onnx node ./test_tts_non_streaming_matcha_icefall_zh.js rm hifigan_v2.onnx diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 1a740005d..b7da9b8a6 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -64,6 +64,7 @@ jobs: ./build-android-arm64-v8a.sh mkdir -p jniLibs/arm64-v8a/ cp -v ./build-android-arm64-v8a/install/lib/*.so ./jniLibs/arm64-v8a/ + cp -v ./build-android-arm64-v8a/install/lib/README.md ./jniLibs/arm64-v8a/ rm -rf ./build-android-arm64-v8a/ - name: build android armv7-eabi @@ -77,6 +78,7 @@ jobs: ./build-android-armv7-eabi.sh mkdir -p ./jniLibs/armeabi-v7a/ cp -v ./build-android-armv7-eabi/install/lib/*.so ./jniLibs/armeabi-v7a/ + cp -v ./build-android-armv7-eabi/install/lib/README.md ./jniLibs/armeabi-v7a/ rm -rf ./build-android-armv7-eabi - name: build android x86_64 @@ -90,6 +92,7 @@ jobs: ./build-android-x86-64.sh mkdir -p ./jniLibs/x86_64 cp -v ./build-android-x86-64/install/lib/*.so ./jniLibs/x86_64 + cp -v ./build-android-x86-64/install/lib/README.md ./jniLibs/x86_64 rm -rf ./build-android-x86-64 - name: build android x86 @@ -103,6 +106,7 @@ jobs: ./build-android-x86.sh mkdir -p ./jniLibs/x86 cp -v ./build-android-x86/install/lib/*.so ./jniLibs/x86 + cp -v ./build-android-x86/install/lib/README.md ./jniLibs/x86 rm -rf ./build-android-x86 - name: Copy files diff --git a/.github/workflows/lazarus.yaml b/.github/workflows/lazarus.yaml index 72958d639..d28b7cba4 100644 --- a/.github/workflows/lazarus.yaml +++ b/.github/workflows/lazarus.yaml @@ -355,6 +355,7 @@ jobs: git clone https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-bin huggingface cd huggingface + git remote set-url origin https://csukuangfj:$HF_TOKEN@huggingface.co/sherpa-onnx-bin git fetch git pull git merge -m "merge remote" --ff origin main diff --git a/build-android-arm64-v8a.sh b/build-android-arm64-v8a.sh index 3d53cc23d..88ba09ef0 100755 --- a/build-android-arm64-v8a.sh +++ b/build-android-arm64-v8a.sh @@ -150,6 +150,22 @@ cp -fv $onnxruntime_version/jni/arm64-v8a/libonnxruntime.so install/lib 2>/dev/n rm -rf install/share rm -rf install/lib/pkgconfig rm -rf install/lib/lib*.a +if [ -f install/lib/libsherpa-onnx-c-api.so ]; then + cat >install/lib/README.md </dev rm -rf install/share rm -rf install/lib/pkgconfig rm -rf install/lib/lib*.a + +if [ -f install/lib/libsherpa-onnx-c-api.so ]; then + cat >install/lib/README.md </dev/null rm -rf install/share rm -rf install/lib/pkgconfig rm -rf install/lib/lib*.a + +if [ -f install/lib/libsherpa-onnx-c-api.so ]; then + cat >install/lib/README.md <install/lib/README.md <