-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·44 lines (35 loc) · 1.05 KB
/
build.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -e -o pipefail
build_wheel()
{
echo "Build package wheel file..."
python3 setup.py bdist_wheel
latest_built_file=$(ls -t ./dist/*.whl | head -n1)
arr_file_token=(${latest_built_file//// })
latest_file_name=${arr_file_token[2]}
arr_file_token=(${latest_file_name//-/ })
latest_file_name="${arr_file_token[0]}-latest-${arr_file_token[2]}-${arr_file_token[3]}-${arr_file_token[4]}"
echo "Copy ${latest_built_file} to .dist/${latest_file_name}"
cp "${latest_built_file}" "./dist/${latest_file_name}"
}
build_egg()
{
echo "Build package egg file..."
python3 setup.py bdist_egg
latest_built_file=$(ls -t ./dist/*.egg | head -n1)
arr_file_token=(${latest_built_file//// })
latest_file_name=${arr_file_token[2]}
arr_file_token=(${latest_file_name//-/ })
latest_file_name="${arr_file_token[0]}-latest.egg"
echo "Copy ${latest_built_file} to .dist/${latest_file_name}"
cp "${latest_built_file}" "./dist/${latest_file_name}"
}
upload2pypi()
{
rm -rf dist/*
python3 setup.py sdist
twine upload dist/*
}
CMD=$1
shift
$CMD $*