forked from sandialabs/SetProgramOptions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexec-makedist.sh
executable file
·38 lines (32 loc) · 1.07 KB
/
exec-makedist.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
#!/usr/bin/env bash
# Source the common helpers script
source scripts/common.bash
printf "${yellow}"
print_banner "Build Distribution - Started"
printf "${normal}\n"
execute_command "rm -rf dist"
execute_command_checked "python3 -m build"
# Upload to TEST PyPi
options=( No Yes )
message_std ""
message_std "${yellow}Upload distribution to ${red}test pypi${normal}:"
upload_to_test_pypi=$(select_with_default "${options[@]}")
if [[ ${upload_to_test_pypi:?} == "Yes" ]]; then
message_std "${cyan}Yes${normal}"
execute_command_checked "python3 -m twine upload --repository testpypi dist/*"
else
message_std "${cyan}No${normal}"
fi
# Upload to production PyPi
message_std ""
message_std "${yellow}Upload distribution to ${red}production pypi${normal}:"
upload_to_prod_pypi=$(select_with_default "${options[@]}")
if [[ ${upload_to_prod_pypi:?} == "Yes" ]]; then
message_std "${cyan}Yes${normal}"
execute_command_checked "python3 -m twine upload dist/*"
else
message_std "${cyan}No${normal}"
fi
printf "${yellow}"
print_banner "Make Distribution - Done"
printf "${normal}\n"