From 792f32094c98825796ddd6cbf651fd3b6aeee14e Mon Sep 17 00:00:00 2001 From: Ohad Mosafi Date: Tue, 11 May 2021 14:15:36 -0700 Subject: [PATCH 1/2] Fix calendar versioning Current month tag exists: - minor promotion -> increase LSB by one - patch promotion -> increase LSB by one Current month tag does not exist: - minor promotion -> current month versioning with 0 as LSB - patch promotion -> Latest tag and promote LSB by one --- ci/release/update-version.sh | 37 +++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 1a32c75a8..346483a11 100644 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -24,15 +24,33 @@ set -e -# Overwrite argument value to always trigger a patch release -RELEASE_TYPE="patch" +# Grab argument for release type +RELEASE_TYPE=$1 + +# Calender versioning only supports "minor"= a PR crated from clara-parabricks/dev branch +# or "patch"= a PR merged from any other branch +if [ "$RELEASE_TYPE" != "patch" ] && [ "$RELEASE_TYPE" != "minor" ]; then + echo "Incorrect release type; use 'minor', or 'patch' as an argument" + exit 1 +fi # Get current version and calculate next versions -CURRENT_TAG=`git tag | grep -xE "v$(date '+%Y\.%m')\.[0-9]+" | sort --version-sort | tail -n 1 | tr -d 'v'` +CURRENT_TAG=$(git tag | grep -xE "v$(date '+%Y\.%m')\.[0-9]+" | sort --version-sort | tail -n 1 | tr -d 'v') + # In case no tag exists for this month if [ -z "${CURRENT_TAG}" ]; then - CURRENT_TAG="$(date '+%Y.%m').-1" + if [ "$RELEASE_TYPE" == "minor" ]; then + # In case no tag exists for this month & this is a + # "minor" release (merged from branch clara-parabricks/dev) - create new tag for this month + CURRENT_TAG="$(date '+%Y.%m').-1" + elif [ "$RELEASE_TYPE" == "patch" ]; then + # In case no tag exists for this month & this is a "patch" release + # (merged from some branch that is not clara-parabricks/dev) - + # take latest Tag that was pushed and increase Patch location in 1 + CURRENT_TAG=$(git tag | grep -xE "v[0-9]+\.[0-9]+\.[0-9]+" | sort --version-sort | tail -n 1 | tr -d 'v') + fi fi + CURRENT_MAJOR=`echo $CURRENT_TAG | awk '{split($0, a, "."); print a[1]}'` CURRENT_MINOR=`echo $CURRENT_TAG | awk '{split($0, a, "."); print a[2]}'` CURRENT_PATCH=`echo $CURRENT_TAG | awk '{split($0, a, "."); print a[3]}'` @@ -40,13 +58,10 @@ NEXT_PATCH=$((CURRENT_PATCH + 1)) NEXT_FULL_TAG="" NEXT_SHORT_TAG="" -if [ "$RELEASE_TYPE" == "patch" ]; then - NEXT_FULL_TAG="${CURRENT_MAJOR}.${CURRENT_MINOR}.${NEXT_PATCH}" - NEXT_SHORT_TAG="${CURRENT_MAJOR}.${CURRENT_MINOR}" -else - echo "Incorrect release type; use 'major', 'minor', or 'patch' as an argument" - exit 1 -fi +NEXT_FULL_TAG="${CURRENT_MAJOR}.${CURRENT_MINOR}.${NEXT_PATCH}" +NEXT_SHORT_TAG="${CURRENT_MAJOR}.${CURRENT_MINOR}" + + if [[ "$CURRENT_PATCH" == "-1" ]]; then echo "Preparing release [$NEXT_FULL_TAG]" else From f3a81cc74b74f2b59a9d9b5f694070ea33b3dcc4 Mon Sep 17 00:00:00 2001 From: Ohad Mosafi Date: Wed, 12 May 2021 09:09:38 -0700 Subject: [PATCH 2/2] install twine using pip --- ci/release/pypi_uploader.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/release/pypi_uploader.sh b/ci/release/pypi_uploader.sh index ac6765361..61979979d 100644 --- a/ci/release/pypi_uploader.sh +++ b/ci/release/pypi_uploader.sh @@ -43,7 +43,7 @@ for f in "${WORKSPACE}"/pygenomeworks/genomeworks_wheel/*.whl; do echo "genomeworks Whl file does not exist" exit 1 else - conda install -c conda-forge twine + pip install twine python3 -m pip install 'readme-renderer>=21.0' # to support py3.5 images # Change .whl package name to support PyPI upload MODIFIED_WHL_NAME=$(dirname ${f})/$(basename "${f}" | sed -r "s/(.*-.+-.+)-.+-.+.whl/\1-none-any.whl/")