Modify cut_version to check in wheel produced.
[pyutils.git] / cut_version.sh
index 094814dd0067fe26b8345ce4c7470b594581c51c..efad099883eee317139a34bed92bf5afb42d6f2d 100755 (executable)
@@ -43,6 +43,8 @@ fi
 
 VERSION=$1
 PREVIOUS_VERSION=$(git tag --sort=-creatordate | head -1)
+git tag --format='%(creatordate:short)%09%(refname:strip=2)'
+echo
 echo "PREVIOUS_VERSION=${PREVIOUS_VERSION}"
 echo
 if ! ask_y_n "About to cut (build, test, package, give you the command to upload) $VERSION, ok?" "N"; then
@@ -74,9 +76,21 @@ 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..."
 python -m build
 
+WHEEL=dist/pyutils-latest-py3-none-any.whl
+if [ ! -f ${WHEEL} ]; then
+    echo "Can't find ${WHEEL}?!"
+    exit 1
+fi
+LINK=dist/pyutils-latest-py3-none-any.whl
+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 push
+
 echo "Done.  To upload, run: \"twine upload --verbose --repository testpypi dist/*\""