<commit_before><commit_msg>- Added release script<commit_after>#!/bin/bash
function advance_version () {
    local v=$1
    # Get the last number. First remove any suffixes (such as '-SNAPSHOT').
    local cleaned=`echo $v | sed -e 's/[^0-9][^0-9]*$//'`
    local last_num=`echo $cleaned | sed -e 's/[0-9]*\.//g'`
    local next_num=$(($last_num+1))
    # Finally replace the last number in version string with the new one.
    echo $v | sed -e "s/[0-9][0-9]*\([^0-9]*\)$/$next_num/"
}

export GIT_MERGE_AUTOEDIT=no
VERSION=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[' | grep -v Download`
RELEASE_VERSION=`echo $VERSION | sed -e 's/[^0-9][^0-9]*$//'`
echo $RELEASE_VERSION
NEW_VERSION=`advance_version $VERSION`
NEW_VERSION=$NEW_VERSION-SNAPSHOT
echo $NEW_VERSION

git flow release start $RELEASE_VERSION
mvn versions:set -DnewVersion=$RELEASE_VERSION versions:commit -q
git add -A
git commit -m "Bump version to $RELEASE_VERSION"
git flow release finish -m "$RELEASE_VERSION" $RELEASE_VERSION
mvn versions:set -DnewVersion=$NEW_VERSION versions:commit -q
git add -A
git commit -m "Bump version to $NEW_VERSION"
git push origin --all
git push origin --tags
{'fraction_non_alphanumeric': 0.15270935960591134, 'fraction_numerical': 0.017241379310344827, 'mean_word_length': 4.417777777777777, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4839360', 'n_tokens_mistral': 447, 'n_tokens_neox': 420, 'n_words': 122}