X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=cut_version.sh;h=00d1c0b930970fc5e31cc515a48db0443c8b7a8f;hb=9f4279db76d66f5045704f6a0d0513e5a8a01910;hp=efad099883eee317139a34bed92bf5afb42d6f2d;hpb=128333be9c3124daa6f026ffbc42c54a7ea1baa0;p=pyutils.git diff --git a/cut_version.sh b/cut_version.sh index efad099..00d1c0b 100755 --- a/cut_version.sh +++ b/cut_version.sh @@ -51,16 +51,20 @@ if ! ask_y_n "About to cut (build, test, package, give you the command to upload echo "Ok, exiting instead." exit 0 fi +LAST_TAG=$(git tag | tail -1) +if [ "${LAST_TAG}" == "${VERSION}" ]; then + echo "Last tag is the same as ${VERSION}?! Aborted." + exit 1 +fi echo echo "Ok, here are the commit message of changes since the last version..." -LAST_TAG=$(git tag | tail -1) git log $LAST_TAG..HEAD pause echo echo -echo "Ok, running scottutilz tests including test_some_dependencies.py..." +echo "Ok, running pyutils and scottutilz tests including test_some_dependencies.py..." cd ../scottutilz/tests ./run_tests.py --all --coverage cd ../../pyutils @@ -75,11 +79,11 @@ printf "# 🎁 Release notes (\`$VERSION\`)\n\n## Changes\n$CHANGES\n\n## Metada echo "Updating pyproject.toml with this version number" cat ./pyproject.template | sed s/##VERSION##/$VERSION/g > ./pyproject.toml -git commit -a -m "Cut version ${VERSION}" -m "${CHANGES}" -echo "Building..." +echo "Building wheel..." python -m build +echo "Checking in wheel package under dist/" WHEEL=dist/pyutils-latest-py3-none-any.whl if [ ! -f ${WHEEL} ]; then echo "Can't find ${WHEEL}?!" @@ -90,7 +94,9 @@ git rm ${LINK} ln -s ${WHEEL} dist/pyutils-latest-py3-none-any.whl git add ${WHEEL} git add ${LINK} -git commit -a -m "Add binary wheel for ${VERSION}" +git commit -a -m "Cut version ${VERSION}" -m "${CHANGES}" + +echo "Pushing changes to git" git push -echo "Done. To upload, run: \"twine upload --verbose --repository testpypi dist/*\"" +echo "Done. To upload, run: \"twine upload --verbose --repository pypi dist/*\""