From 70e3f031e96b713a8435c907b3602ffa762bff36 Mon Sep 17 00:00:00 2001 From: joncrall Date: Fri, 24 Sep 2021 00:33:32 -0400 Subject: [PATCH] Update changelog and publish script --- CHANGELOG.md | 2 +- publish.sh | 69 +++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 61 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8af49bc4..859e2b8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ We are currently working on porting this changelog to the specifications in [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Version 0.15.9 - Unreleased +## Version 0.15.9 - Released 2021-09-24 ### Changed diff --git a/publish.sh b/publish.sh index 96eb6901..a765e45c 100755 --- a/publish.sh +++ b/publish.sh @@ -83,7 +83,7 @@ normalize_boolean(){ DEPLOY_REMOTE=${DEPLOY_REMOTE:=origin} NAME=${NAME:=$(python -c "import setup; print(setup.NAME)")} VERSION=$(python -c "import setup; print(setup.VERSION)") -MB_PYTHON_TAG=${MB_PYTHON_TAG:py3-none-any} +MB_PYTHON_TAG=${MB_PYTHON_TAG:=py3-none-any} # The default should change depending on the application #DEFAULT_MODE_LIST=("sdist" "universal" "bdist") @@ -91,14 +91,13 @@ DEFAULT_MODE_LIST=("sdist" "native" "universal") #DEFAULT_MODE_LIST=("sdist" "bdist") check_variable DEPLOY_REMOTE -check_variable VERSION || exit 1 ARG_1=$1 DO_UPLOAD=${DO_UPLOAD:=$ARG_1} DO_TAG=${DO_TAG:=$ARG_1} -DO_GPG=${DO_GPG:="True"} -DO_BUILD=${DO_BUILD:="True"} +DO_GPG=${DO_GPG:="auto"} +DO_BUILD=${DO_BUILD:="auto"} DO_GPG=$(normalize_boolean "$DO_GPG") DO_BUILD=$(normalize_boolean "$DO_BUILD") @@ -124,6 +123,8 @@ fi GPG_KEYID=${GPG_KEYID:=$(git config --local user.signingkey)} GPG_KEYID=${GPG_KEYID:=$(git config --global user.signingkey)} +WAS_INTERACTION="False" + echo " === PYPI BUILDING SCRIPT == @@ -147,29 +148,77 @@ else if [[ "$DO_TAG" == "False" ]]; then echo "We are NOT about to tag VERSION='$VERSION'" else - read -p "Do you want to git tag version='$VERSION'? (input 'yes' to confirm)" ANS + read -p "Do you want to git tag and push version='$VERSION'? (input 'yes' to confirm)" ANS echo "ANS = $ANS" + WAS_INTERACTION="True" DO_TAG="$ANS" DO_TAG=$(normalize_boolean "$DO_TAG") + if [ "$DO_BUILD" == "auto" ]; then + DO_BUILD="" + DO_GPG="" + fi + fi +fi + + +# Verify that we want to build +if [ "$DO_BUILD" == "auto" ]; then + DO_BUILD="True" +fi +# Verify that we want to build +if [ "$DO_GPG" == "auto" ]; then + DO_GPG="True" +fi + +if [[ "$DO_BUILD" == "True" ]]; then + echo "About to build wheels" +else + if [[ "$DO_UPLOAD" == "False" ]]; then + echo "We are NOT about to build wheels" + else + read -p "Do you need to build wheels? (input 'yes' to confirm)" ANS + echo "ANS = $ANS" + WAS_INTERACTION="True" + DO_BUILD="$ANS" + DO_BUILD=$(normalize_boolean "$DO_BUILD") fi fi # Verify that we want to publish if [[ "$DO_UPLOAD" == "True" ]]; then - echo "About to publish VERSION='$VERSION'" + echo "About to directly publish VERSION='$VERSION'" else if [[ "$DO_UPLOAD" == "False" ]]; then - echo "We are NOT about to publish VERSION='$VERSION'" + echo "We are NOT about to directly publish VERSION='$VERSION'" else - read -p "Are you ready to publish version='$VERSION'? (input 'yes' to confirm)" ANS + read -p "Are you ready to directly publish version='$VERSION'? ('yes' will twine upload)" ANS echo "ANS = $ANS" + WAS_INTERACTION="True" DO_UPLOAD="$ANS" DO_UPLOAD=$(normalize_boolean "$DO_UPLOAD") fi fi +if [[ "$WAS_INTERACTION" == "True" ]]; then + echo " + === PYPI BUILDING SCRIPT == + VERSION='$VERSION' + TWINE_USERNAME='$TWINE_USERNAME' + TWINE_REPOSITORY_URL = $TWINE_REPOSITORY_URL + GPG_KEYID = '$GPG_KEYID' + MB_PYTHON_TAG = '$MB_PYTHON_TAG' + + DO_UPLOAD=${DO_UPLOAD} + DO_TAG=${DO_TAG} + DO_GPG=${DO_GPG} + DO_BUILD=${DO_BUILD} + " + read -p "Look good? Ready? Enter any text to continue" ANS +fi + + MODE=${MODE:=all} @@ -301,7 +350,9 @@ fi if [[ "$DO_TAG" == "True" ]]; then git tag $VERSION -m "tarball tag $VERSION" - git push --tags $DEPLOY_REMOTE $DEPLOY_BRANCH + git push --tags $DEPLOY_REMOTE + echo "Should also do a: git push $DEPLOY_REMOTE main:release" + echo "For github should draft a new release: https://github.com/Erotemic/xdoctest/releases/new" else echo "Not tagging" fi