From 61bce32965191c43af855bb7c85516af9f2a0e33 Mon Sep 17 00:00:00 2001 From: Raffaele Mancuso Date: Thu, 6 Jan 2022 10:17:09 +0100 Subject: [PATCH] Changelog update and release script --- CHANGELOG | 6 ++-- pdfsak_version.py | 2 +- release.sh | 72 +++++++++++++++++++++++++++++++++++++++++++++++ upload_to_pypi.sh | 9 ------ 4 files changed, 76 insertions(+), 13 deletions(-) create mode 100644 release.sh delete mode 100644 upload_to_pypi.sh diff --git a/CHANGELOG b/CHANGELOG index 115f0f6..41abb67 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,9 +1,9 @@ - +v 1.1.2 (2022-01-06) * Single source of truth for version * Launcher for Windows -* Can specify options for Adobe Acrobat Clearscan simulation +* Additional options for Adobe Acrobat Clearscan simulation -v 1.1 (2021-11-25) +v 1.1.0 (2021-11-25) * Can simulate Adobe Acrobat Clearscan (improve quality of scanned document) diff --git a/pdfsak_version.py b/pdfsak_version.py index 83ba70c..af50f06 100644 --- a/pdfsak_version.py +++ b/pdfsak_version.py @@ -1,2 +1,2 @@ #!/usr/bin/env python3 -__version__ = "1.1.1" +__version__ = "1.2.4" diff --git a/release.sh b/release.sh new file mode 100644 index 0000000..0321d61 --- /dev/null +++ b/release.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash + +read -p "Insert version number in the form A.B.C: " ver + +# Change version in configuration file +sed -i -E "s/[0-9]+\.[0-9]+\.[0-9]+/$ver/g" pdfsak_version.py + +echo "Echoing pdfsak_version.py" +cat pdfsak_version.py +read -p "Does it look correct (y/n)? " ans + +if [ "$ans" = "y" ]; then + echo "Answered yes. Proceeding." +elif [ "$ans" = "n" ]; then + echo "Answered no. Exiting" + exit +else + echo "Unrecognized answer" +fi + +# Create commit for version bump + +git add -A +git commit -m "Bump version to $ver" + +echo "Echoing commit for version bump" +git diff HEAD^ + +read -p "Does it look correct (y/n)? " ans + +if [ "$ans" = "y" ]; then + echo "Answered yes. Proceeding." +elif [ "$ans" = "n" ]; then + echo "Answered no. Exiting" + exit +else + echo "Unrecognized answer" +fi + +# Create annotated tag for this version +git tag -a v$ver -m "Version $ver" + +echo "Echoing git tags" +git tag --list + +read -p "Does it look correct (y/n)? " ans + +if [ "$ans" = "y" ]; then + echo "Answered yes. Proceeding." +elif [ "$ans" = "n" ]; then + echo "Answered no. Exiting" + exit +else + echo "Unrecognized answer" +fi + +# Push commit +git push + +# Push tag +git push origin v$ver + +# Build project +rm -rf dist/ +rm -rf build/ +rm -rf *.egg-info +python3 -m build + +# Upload to PyPI +python3 -m twine upload dist/* + +echo "Done. Remember to release on GitHub" diff --git a/upload_to_pypi.sh b/upload_to_pypi.sh deleted file mode 100644 index 59271c3..0000000 --- a/upload_to_pypi.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -rm -rf dist/ -rm -rf build/ -rm -rf *.egg-info - -python3 -m build - -python3 -m twine upload dist/*