<commit_before>#!/bin/bash

TAG=1

if [ "$1" == "--no-tag" ];  then
  TAG=0
  shift
fi

if [ "$#" -ne 1 ];  then
  echo "usage: $0 <major>.<minor>.<patchlevel>"
  exit 1
fi

VERSION="$1"

git tag | grep -q "^v$VERSION$"

if [ "$?" == 0 ];  then
  echo "$0: version $VERSION already defined"
  exit 1
fi

fgrep -q "v$VERSION" CHANGELOG

if [ "$?" != 0 ];  then
  echo "$0: version $VERSION not defined in CHANGELOG"
  exit 1
fi

echo "$VERSION" > VERSION

cat configure.ac \
  | sed -e 's~AC_INIT(\[\(.*\)\], \[.*\..*\..*\], \[\(.*\)\], \[\(.*\)\], \[\(.*\)\])~AC_INIT([\1], ['$VERSION'], [\2], [\3], [\4\])~' \
  > configure.ac.tmp \
 || exit 1

mv configure.ac.tmp configure.ac

./configure --enable-maintainer-mode || exit 1
make built-sources || exit 1
make add-maintainer || exit 1
make add-automagic || exit 1

make || exit 1
make examples || exit 1
make swagger || exit 1

git add -f Documentation/Examples/*.generated

case "$TAG" in
  *-alpha*|*-beta*|devel)
    git rm -f EXPERIMENTAL
    ;;
esac

if [ "$TAG" == "1" ];  then
  git commit -m "release version $VERSION" -a
  git push

  git tag "v$VERSION"
  git push --tags
fi<commit_msg>Build the documentation in the release process to enshure its valid before doing the tag.<commit_after>#!/bin/bash

TAG=1

if [ "$1" == "--no-tag" ];  then
  TAG=0
  shift
fi

if [ "$#" -ne 1 ];  then
  echo "usage: $0 <major>.<minor>.<patchlevel>"
  exit 1
fi

VERSION="$1"

git tag | grep -q "^v$VERSION$"

if [ "$?" == 0 ];  then
  echo "$0: version $VERSION already defined"
  exit 1
fi

fgrep -q "v$VERSION" CHANGELOG

if [ "$?" != 0 ];  then
  echo "$0: version $VERSION not defined in CHANGELOG"
  exit 1
fi

echo "$VERSION" > VERSION

cat configure.ac \
  | sed -e 's~AC_INIT(\[\(.*\)\], \[.*\..*\..*\], \[\(.*\)\], \[\(.*\)\], \[\(.*\)\])~AC_INIT([\1], ['$VERSION'], [\2], [\3], [\4\])~' \
  > configure.ac.tmp \
 || exit 1

mv configure.ac.tmp configure.ac

./configure --enable-maintainer-mode || exit 1
make built-sources || exit 1
make add-maintainer || exit 1
make add-automagic || exit 1

make || exit 1
make examples || exit 1
make swagger || exit 1

git add -f Documentation/Examples/*.generated

cd Documentation/Books; make ||exit 1

case "$TAG" in
  *-alpha*|*-beta*|devel)
    git rm -f EXPERIMENTAL
    ;;
esac

if [ "$TAG" == "1" ];  then
  git commit -m "release version $VERSION" -a
  git push

  git tag "v$VERSION"
  git push --tags
fi
{'fraction_non_alphanumeric': 0.21378165213781652, 'fraction_numerical': 0.022000830220008302, 'mean_word_length': 2.807266982622433, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1841262', 'n_tokens_mistral': 985, 'n_tokens_neox': 912, 'n_words': 288}