feat: mac package dmg

This commit is contained in:
rankun 2020-03-13 16:46:34 +08:00
commit 4f013e58b5
6 changed files with 117 additions and 3 deletions

37
ci/mac/package_for_mac.sh Executable file
View file

@ -0,0 +1,37 @@
# 获取绝对路径,保证其他目录执行此脚本依然正确
{
cd $(dirname "$0")
script_path=$(pwd)
cd -
} &> /dev/null # disable output
# 设置当前目录cd的目录影响接下来执行程序的工作目录
old_cd=$(pwd)
cd $(dirname "$0")
echo
echo
echo ---------------------------------------------------------------
echo pip install requirements
echo ---------------------------------------------------------------
pip install -r $script_path/package/requirements.txt
if [ $? -ne 0 ] ;then
echo "pip install requirements failed"
exit 1
fi
echo
echo
echo ---------------------------------------------------------------
echo create package
echo ---------------------------------------------------------------
python $script_path/package/package.py
if [ $? -ne 0 ] ;then
echo "create package failed"
exit 1
fi
# 恢复当前目录
cd $old_cd
exit 0