diff --git a/build.sh b/build.sh index d3b53a6..240494e 100755 --- a/build.sh +++ b/build.sh @@ -1,2 +1,2 @@ #!/bin/sh - -python3 setup.py sdist bdist_wheel +python3 -m build diff --git a/publish.sh b/publish.sh index d95cea3..f16b62b 100755 --- a/publish.sh +++ b/publish.sh @@ -58,7 +58,27 @@ if [ "$(echo "$PTYPE" | grep -E '(pypi|test)')" = "" ]; then exit 1 fi +# Set the token +_TOKEN=$test_token # Default +_REPO="testpypi" +if [ "$(echo "$PTYPE" | grep -E '(pypi)')" = "pypi" ]; then + _TOKEN=$pypi_token + _REPO="pypi" + echo "Publishing to PYPI official..." +fi + +# Upgrade pip packages +python3 -m pip install pip --upgrade +python3 -m pip install setuptools --upgrade +python3 -m pip install wheel --upgrade +python3 -m pip install twine --upgrade +python3 -m pip install build --upgrade + +# build current version +# note: mkae sure to update setup.py first +python3 -m build + # command: python3 -m twine upload --username $_USERNAME --password $_TOKEN --non-interactive --repository $_REPO dist/* -python3 -m twine upload --username $_USERNAME --password $_TOKEN --non-interactive --repository $_REPO dist/* +python3 -m twine upload --verbose --username $_USERNAME --password $_TOKEN --non-interactive --repository $_REPO dist/*