X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=cut_version.sh;h=10b4e1a4dc449998d7c5db16d4da968397d61b2d;hb=18e57272c7fb10ff72a87df8f47760367d355bbe;hp=7e40e9866296b4ad6ebfd38f60b0a5f12d0b767a;hpb=a94184ff1b3445897ddd2252021943c4b3481e52;p=pyutils.git diff --git a/cut_version.sh b/cut_version.sh index 7e40e98..10b4e1a 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,10 +79,30 @@ 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}" -git push -echo "Building..." +echo "Building wheel..." python -m build -echo "Done. To upload, run: \"twine upload --verbose --repository testpypi dist/*\"" +echo "Checking in wheel package under dist/" +cd dist +WHEEL=pyutils-${VERSION}-py3-none-any.whl +if [ ! -f ${WHEEL} ]; then + echo "Can't find ${WHEEL}?!" + exit 1 +fi +LINK=pyutils-latest-py3-none-any.whl +git rm -f ${LINK} +ln -s ${WHEEL} ${LINK} +git add ${WHEEL} +git add ${LINK} +for FILE in *.whl; do + md5 ${FILE} > ${FILE}.md5 +done +git add *.md5 +cd .. +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 pypi dist/pyutils-${VERSION}*.whl\""