Skip to content

Commit

Permalink
Update changelog and publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Sep 24, 2021
1 parent 5aa4fc5 commit 70e3f03
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
69 changes: 60 additions & 9 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,21 @@ 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")
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")
Expand All @@ -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 ==
Expand All @@ -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}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 70e3f03

Please sign in to comment.