Last active
March 6, 2020 05:21
-
-
Save fieldju/2c960e1f1412d19a4649647e9c0a5a42 to your computer and use it in GitHub Desktop.
Gist for determining if should be patch or minor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
TAGS=$(git tag -l) | |
BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
BRANCH_WITH_RELEASE_TRIMMED=${BRANCH//release-/} | |
BRANCH_WITH_X_SUFFIX_TRIMMED=${BRANCH_WITH_RELEASE_TRIMMED//.x/} | |
VERSION_PREFIX=$BRANCH_WITH_X_SUFFIX_TRIMMED | |
PATTERN="v${VERSION_PREFIX}" | |
echo "Searching for tags that start with: ${PATTERN}" | |
git tag -l | grep ${PATTERN} | |
DO_TAGS_WITH_PREFIX_EXIST=$(git tag -l | grep -c ${PATTERN}) | |
echo "DO_TAGS_WITH_PREFIX_EXIST=${DO_TAGS_WITH_PREFIX_EXIST}" | |
[[ $DO_TAGS_WITH_PREFIX_EXIST ]] && RELEASE_SCOPE="patch" || RELEASE_SCOPE="minor" | |
./gradlew final artifactoryPublish -Prelease.scope=${RELEASE_SCOPE} $GRADLE_ARGS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment