mindspore/scripts/lite_release_package.sh

89 lines
3.1 KiB
Bash
Raw Normal View History

2020-12-19 17:12:43 +08:00
#!/bin/bash
2021-03-12 16:42:55 +08:00
# Copyright 2020-2021 Huawei Technologies Co., Ltd
2020-12-19 17:12:43 +08:00
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
set -e
function android_release_package()
{
2021-04-02 14:40:58 +08:00
arch=$1
device=$2
2021-06-16 14:42:58 +08:00
pkg_name="mindspore-lite-${version}-android-${arch}"
rm -rf ${pkg_name}
tar -xzf ${input_path}/android_${arch}/${device}/${pkg_name}.tar.gz
# Copy java runtime to Android package
2021-06-26 11:40:16 +08:00
cp ${input_path}/aar/mindspore-lite-*maven*.zip ${pkg_name}
2021-06-16 14:42:58 +08:00
mkdir -p ${output_path}/release/android/${device}/
tar -czf ${output_path}/release/android/${device}/${pkg_name}.tar.gz ${pkg_name}
rm -rf ${pkg_name}
2021-04-02 14:40:58 +08:00
cd ${output_path}/release/android/${device}/
2021-06-16 14:42:58 +08:00
sha256sum ${pkg_name}.tar.gz > ${pkg_name}.tar.gz.sha256
2020-12-19 17:12:43 +08:00
}
2021-06-16 14:42:58 +08:00
function ios_release_package()
2020-12-19 17:12:43 +08:00
{
2021-06-16 14:42:58 +08:00
mkdir -p ${output_path}/release/ios/
2021-06-26 11:40:16 +08:00
cp ${input_path}/ios_aarch64/*.tar.gz* ${output_path}/release/ios/
cp ${input_path}/ios_aarch32/*.tar.gz* ${output_path}/release/ios/
2021-06-16 14:42:58 +08:00
}
2021-03-12 16:42:55 +08:00
2021-06-16 14:42:58 +08:00
function linux_release_package()
{
2021-07-10 15:30:57 +08:00
mkdir -p ${output_path}/release/linux/nnie/
2022-01-04 17:11:11 +08:00
mkdir -p ${output_path}/release/linux/x86_64/
mkdir -p ${output_path}/release/linux/aarch64/
cp ${input_path}/centos_x86/avx/*.tar.gz* ${output_path}/release/linux/x86_64/
cp ${input_path}/linux_aarch64/*.tar.gz* ${output_path}/release/linux/aarch64/
2021-07-10 15:30:57 +08:00
2021-12-20 19:39:11 +08:00
cp -r ${input_path}/linux_aarch32/nnie/Hi* ${output_path}/release/linux/nnie/
2022-01-04 17:11:11 +08:00
cp -r ${input_path}/linux_aarch64/nnie/Hi* ${output_path}/release/linux/nnie/
cp ${input_path}/centos_x86/nnie/Hi3516D/*.tar.gz* ${output_path}/release/linux/nnie/
2020-12-19 17:12:43 +08:00
}
function windows_release_package()
{
2021-06-16 14:42:58 +08:00
mkdir -p ${output_path}/release/windows/
cp ${input_path}/windows_x64/avx/*.zip* ${output_path}/release/windows/
2021-06-26 11:40:16 +08:00
cp ${input_path}/windows_x32/sse/*.zip* ${output_path}/release/windows/
2020-12-19 17:12:43 +08:00
}
2021-09-26 17:14:01 +08:00
function openharmony_release_package()
{
mkdir -p ${output_path}/release/openharmony/
cp ${input_path}/ohos_aarch32/*.tar.gz* ${output_path}/release/openharmony/
}
2020-12-19 17:12:43 +08:00
echo "============================== begin =============================="
echo "Usage: bash lite_release_package.sh input_path output_path"
input_path=$1
output_path=$2
2021-06-26 11:40:16 +08:00
version=`ls ${input_path}/android_aarch64/npu/mindspore-lite-*-*.tar.gz | awk -F'/' '{print $NF}' | cut -d"-" -f3`
2020-12-19 17:12:43 +08:00
2021-06-26 11:40:16 +08:00
android_release_package aarch32 npu
android_release_package aarch32 cpu
android_release_package aarch64 npu
2021-04-02 14:40:58 +08:00
android_release_package aarch64 gpu
2021-06-26 11:40:16 +08:00
ios_release_package
2020-12-19 17:12:43 +08:00
linux_release_package
windows_release_package
2021-09-26 17:14:01 +08:00
openharmony_release_package
2020-12-19 17:12:43 +08:00
echo "Create release package success!"
echo "=============================== end ==============================="