-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrelease.sh
29 lines (21 loc) · 984 Bytes
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Get current working directory with full path
fullPath=$(pwd)
# Get only directory name without path
dirNameOrigin=$(basename $fullPath)
dirName=${dirNameOrigin//-/_}
echo $dirName
# pypi token
pypi_token=$(cat PYPI_TOKEN)
# 从__init__.py文件中读取版本信息
version=$(python -c "from src.$dirName import __version__; print(__version__)")
echo $version
# build & publish
/usr/bin/python3.8 -m poetry build && \
/usr/bin/python3.8 -m poetry publish -u __token__ -p $pypi_token
# pyinstaller linux exec file
/usr/bin/python3.8 -m poetry run pyinstaller -F src/$dirName/__main__.py -n $dirNameOrigin-linux && \
# Compress the executable file
zip -j ./dist/$dirNameOrigin-$version-linux.zip ./dist/$dirNameOrigin-linux ./scripts/Chinese-simple.sh scripts/English.sh scripts/start.sh
zip -j ./dist/$dirNameOrigin-$version-win64.zip ./dist/$dirNameOrigin-win64.exe scripts/Chinese-simple.bat scripts/English.bat scripts/start.bat
# todo 把停用词也更新了