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 45 46 47 48 49 50 51 52 53 54 55 56 57
|
#!/bin/bash
set -e
function yes_or_no {
while true; do
read -p "$* [y/n]: " yn
case $yn in
[Yy]*) return 0 ;;
[Nn]*)
echo "Aborted"
return 1
;;
esac
done
}
CUR_VERSION=$($(dirname $0)/version-core)
VERSION=$1
if [ -z $VERSION ]; then
echo "Usage: $0 VERSION"
echo "Current version: $CUR_VERSION"
exit 1
fi
set -x
$(dirname $0)/version-set.py $VERSION
sudo rm -rf dist build
mkdir dist build
python3 setup.py sdist bdist_wheel
pip3 install ./dist/*.whl -U --user --force-reinstall
du -k dist/*
echo "-------------- Check version in GUI: --------------"
~/.local/bin/pyglossary
yes_or_no "Continue creating the release?" || exit 1
git add setup.py pyglossary/core.py pyproject.toml about _license-dialog
git commit -m "version $VERSION" || echo "------ Already committed"
git -p show || true
git -p log || true
echo "Pushing to origin..."
git push
echo "Creating tag $VERSION"
git tag -a -m "version $VERSION" $VERSION
echo "Pushing tag to origin..."
git push origin $VERSION
echo "Publishing to pypi"
python3 -m twine upload --repository pypi dist/* --verbose
|