<commit_before>#!/usr/bin/env bash

# Fail script on error
set -e

cd .travis
mkdir secrets

# GPG is required for artifact signing
openssl aes-256-cbc -k "$SUPER_SECRET_KEY" -in secrets.tar.enc -out secrets/secrets.tar -d

cd secrets
tar xvf secrets.tar

gpg --import gpg-secret.key
gpg --import-ownertrust gpg-ownertrust

# Decrypt GitHub SSH key
chmod 600 github_deploy
eval $(ssh-agent -s)
ssh-add ./github_deploy

cd ..
rm -rf ./secrets

cd ..

git config --global user.name "pgjdbc CI"
git config --global user.email "<EMAIL>"

# By default Travis checks out commit, and maven-release-plugin wants to know branch name
# On top of that, maven-release-plugin publishes branch, and it would terminate Travis job (current one!),
# so we checkout a non-existing branch, so it won't get published
# Note: at the end, we need to update "master" branch accordingly" (see $ORIGINAL_BRANCH)
TMP_BRANCH=tmp/$TRAVIS_BRANCH
git checkout -b "$TMP_BRANCH"

# Remove tmp branch if exists
git push <EMAIL>:$TRAVIS_REPO_SLUG.git ":$TMP_BRANCH" || true

set -x
# -Darguments here is for maven-release-plugin
MVN_SETTINGS=$(pwd)/.travis/settings.xml
mvn -B --settings .travis/settings.xml -Darguments="--settings '${MVN_SETTINGS}'" release:prepare release:perform

# Point "master" branch to "next development snapshot commit"
ORIGINAL_BRANCH=${TRAVIS_BRANCH#release/}
git push <EMAIL>:$TRAVIS_REPO_SLUG.git "HEAD:$ORIGINAL_BRANCH"
# Removal of the temporary branch is a separate command, so it left behind for the analysis in case "push to master" fails
git push <EMAIL>:$TRAVIS_REPO_SLUG.git ":$TMP_BRANCH"<commit_msg>chore: remove release tag if exists when releasing via Travis<commit_after>#!/usr/bin/env bash

# Fail script on error
set -e

cd .travis
mkdir secrets

# GPG is required for artifact signing
openssl aes-256-cbc -k "$SUPER_SECRET_KEY" -in secrets.tar.enc -out secrets/secrets.tar -d

cd secrets
tar xvf secrets.tar

gpg --import gpg-secret.key
gpg --import-ownertrust gpg-ownertrust

# Decrypt GitHub SSH key
chmod 600 github_deploy
eval $(ssh-agent -s)
ssh-add ./github_deploy

cd ..
rm -rf ./secrets

cd ..

git config --global user.name "pgjdbc CI"
git config --global user.email "<EMAIL>"

# By default Travis checks out commit, and maven-release-plugin wants to know branch name
# On top of that, maven-release-plugin publishes branch, and it would terminate Travis job (current one!),
# so we checkout a non-existing branch, so it won't get published
# Note: at the end, we need to update "master" branch accordingly" (see $ORIGINAL_BRANCH)
TMP_BRANCH=tmp/$TRAVIS_BRANCH
git checkout -b "$TMP_BRANCH"

# Remove tmp branch if exists
git push <EMAIL>:$TRAVIS_REPO_SLUG.git ":$TMP_BRANCH" || true
# Remove release tag if exists just in case
git push <EMAIL>:$TRAVIS_REPO_SLUG.git :$RELEASE_TAG || true

set -x
# -Darguments here is for maven-release-plugin
MVN_SETTINGS=$(pwd)/.travis/settings.xml
mvn -B --settings .travis/settings.xml -Darguments="--settings '${MVN_SETTINGS}'" release:prepare release:perform

# Point "master" branch to "next development snapshot commit"
ORIGINAL_BRANCH=${TRAVIS_BRANCH#release/}
git push <EMAIL>:$TRAVIS_REPO_SLUG.git "HEAD:$ORIGINAL_BRANCH"
# Removal of the temporary branch is a separate command, so it left behind for the analysis in case "push to master" fails
git push <EMAIL>:$TRAVIS_REPO_SLUG.git ":$TMP_BRANCH"
{'fraction_non_alphanumeric': 0.10549777117384844, 'fraction_numerical': 0.003566121842496285, 'mean_word_length': 4.666666666666667, 'pattern_counts': {'":': 4, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '1728256', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1165, 'n_words': 397}