You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

lite_release_package.sh 2.9 kB

5 years ago
4 years ago
4 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #!/bin/bash
  2. # Copyright 2020-2021 Huawei Technologies Co., Ltd
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. # ============================================================================
  16. set -e
  17. function android_release_package()
  18. {
  19. arch=$1
  20. device=$2
  21. pkg_name="mindspore-lite-${version}-android-${arch}"
  22. rm -rf ${pkg_name}
  23. tar -xzf ${input_path}/android_${arch}/${device}/${pkg_name}.tar.gz
  24. # Copy java runtime to Android package
  25. cp ${input_path}/aar/mindspore-lite-*maven*.zip ${pkg_name}
  26. mkdir -p ${output_path}/release/android/${device}/
  27. tar -czf ${output_path}/release/android/${device}/${pkg_name}.tar.gz ${pkg_name}
  28. rm -rf ${pkg_name}
  29. cd ${output_path}/release/android/${device}/
  30. sha256sum ${pkg_name}.tar.gz > ${pkg_name}.tar.gz.sha256
  31. }
  32. function ios_release_package()
  33. {
  34. mkdir -p ${output_path}/release/ios/
  35. cp ${input_path}/ios_aarch64/*.tar.gz* ${output_path}/release/ios/
  36. cp ${input_path}/ios_aarch32/*.tar.gz* ${output_path}/release/ios/
  37. }
  38. function linux_release_package()
  39. {
  40. mkdir -p ${output_path}/release/linux/nnie/
  41. cp ${input_path}/ubuntu_x86/avx/*.tar.gz* ${output_path}/release/linux/
  42. cp ${input_path}/linux_aarch32/*.tar.gz* ${output_path}/release/linux/
  43. cp ${input_path}/ubuntu_x86/nnie/3516D/*.tar.gz* ${output_path}/release/linux/nnie/
  44. }
  45. function windows_release_package()
  46. {
  47. mkdir -p ${output_path}/release/windows/
  48. cp ${input_path}/windows_x64/avx/*.zip* ${output_path}/release/windows/
  49. cp ${input_path}/windows_x32/sse/*.zip* ${output_path}/release/windows/
  50. }
  51. function openharmony_release_package()
  52. {
  53. mkdir -p ${output_path}/release/openharmony/
  54. cp ${input_path}/ohos_aarch32/*.tar.gz* ${output_path}/release/openharmony/
  55. }
  56. echo "============================== begin =============================="
  57. echo "Usage: bash lite_release_package.sh input_path output_path"
  58. input_path=$1
  59. output_path=$2
  60. version=`ls ${input_path}/android_aarch64/npu/mindspore-lite-*-*.tar.gz | awk -F'/' '{print $NF}' | cut -d"-" -f3`
  61. android_release_package aarch32 npu
  62. android_release_package aarch32 cpu
  63. android_release_package aarch64 npu
  64. android_release_package aarch64 gpu
  65. ios_release_package
  66. linux_release_package
  67. windows_release_package
  68. openharmony_release_package
  69. echo "Create release package success!"
  70. echo "=============================== end ==============================="