release.sh 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!/usr/bin/env bash
  2. #
  3. # Copyright (c) 2023 Xiaomi Corporation
  4. #
  5. # Please see the end of this file for what files it will generate
  6. SHERPA_NCNN_VERSION=$(grep "SHERPA_NCNN_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
  7. echo "SHERPA_NCNN_VERSION: ${SHERPA_NCNN_VERSION}"
  8. dst=v${SHERPA_NCNN_VERSION}
  9. if [ -d $dst ]; then
  10. echo "$dst exists - skipping"
  11. exit 0
  12. fi
  13. ./build-android-x86-64.sh
  14. ./build-android-armv7-eabi.sh
  15. ./build-android-x86-64.sh
  16. ./build-ios.sh
  17. mkdir -p $dst/jniLibs/arm64-v8a
  18. cp -v ./build-android-arm64-v8a/install/lib/*.so $dst/jniLibs/arm64-v8a/
  19. mkdir -p $dst/jniLibs/armeabi-v7a
  20. cp -v ./build-android-armv7-eabi/install/lib/*.so $dst/jniLibs/armeabi-v7a/
  21. mkdir -p $dst/jniLibs/x86_64
  22. cp -v ./build-android-x86-64/install/lib/*.so $dst/jniLibs/x86_64
  23. mkdir -p $dst/build-ios/
  24. cp -av ./build-ios/sherpa-ncnn.xcframework $dst/build-ios/
  25. cp -av ./build-ios/openmp.xcframework $dst/build-ios/
  26. cd $dst
  27. tar cjvf sherpa-ncnn-v${SHERPA_NCNN_VERSION}-pre-compiled-android-libs.tar.bz2 ./jniLibs
  28. tar cjvf sherpa-ncnn-v${SHERPA_NCNN_VERSION}-pre-compiled-ios-libs.tar.bz2 ./build-ios
  29. # .
  30. # ├── build-ios
  31. # │   ├── openmp.xcframework
  32. # │   │   ├── Headers
  33. # │   │   │   └── omp.h
  34. # │   │   ├── Info.plist
  35. # │   │   ├── ios-arm64
  36. # │   │   │   └── libomp.a
  37. # │   │   └── ios-arm64_x86_64-simulator
  38. # │   │   └── libomp.a
  39. # │   └── sherpa-ncnn.xcframework
  40. # │   ├── Headers
  41. # │   │   └── sherpa-ncnn
  42. # │   │   └── c-api
  43. # │   │   └── c-api.h
  44. # │   ├── Info.plist
  45. # │   ├── ios-arm64
  46. # │   │   └── sherpa-ncnn.a
  47. # │   └── ios-arm64_x86_64-simulator
  48. # │   └── sherpa-ncnn.a
  49. # ├── jniLibs
  50. # │   ├── arm64-v8a
  51. # │   │   ├── libkaldi-native-fbank-core.so
  52. # │   │   ├── libncnn.so
  53. # │   │   ├── libsherpa-ncnn-core.so
  54. # │   │   └── libsherpa-ncnn-jni.so
  55. # │   ├── armeabi-v7a
  56. # │   │   ├── libkaldi-native-fbank-core.so
  57. # │   │   ├── libncnn.so
  58. # │   │   ├── libsherpa-ncnn-core.so
  59. # │   │   └── libsherpa-ncnn-jni.so
  60. # │   └── x86_64
  61. # │   ├── libkaldi-native-fbank-core.so
  62. # │   ├── libncnn.so
  63. # │   ├── libsherpa-ncnn-core.so
  64. # │   └── libsherpa-ncnn-jni.so
  65. # ├── sherpa-ncnn-v1.8.1-pre-compiled-android-libs.tar.bz2
  66. # └── sherpa-ncnn-v1.8.1-pre-compiled-ios-libs.tar.bz2
  67. #
  68. # 15 directories, 22 files