<commit_before>#!/bin/bash

set -e

if [ -z "$TRAVIS_TAG" ]
then
    echo "No tag present, do nothing"
    exit
fi

source travis/bump-versioncode.sh

if $(echo "$TRAVIS_TAG" | grep -q "beta")
then
    python3 assets/store_descriptions/generate_and_validate.py fdroidBeta
else
    python3 assets/store_descriptions/generate_and_validate.py fdroid
fi

curl https://api.github.com/repos/openhab/openhab-android/releases | jq -r '.[0].body' > fastlane/metadata/android/en-US/changelogs/${currentVersionCode}.txt

git config --local user.name "openhab-bot"
git config --local user.email "<EMAIL>"
echo "Git add"
git add fastlane/metadata/* "mobile/build.gradle"
echo "Git commit"
git commit -m "Bump version to $TRAVIS_TAG and update fastlane metadata"
echo "Git tag"
git tag -a "${TRAVIS_TAG}-fdroid" -m "${TRAVIS_TAG} for F-Droid"
echo "Git decrypt key"
openssl aes-256-cbc -K $encrypted_c0c05d762590_key -iv $encrypted_c0c05d762590_iv -in travis/key.enc -out travis/key -d > /dev/null 2>&1
echo "Copy ssh config"
cp travis/ssh-config ~/.ssh/config
echo "Change key permissions"
chmod 400 travis/key
echo "Git create master branch"
git checkout -b master
echo "Git add remote"
git remote add github <EMAIL>:openhab/openhab-android > /dev/null 2>&1
echo "Git fetch"
git fetch github > /dev/null 2>&1<commit_msg>Retry download of changelog (#1054)<commit_after>#!/bin/bash

set -e

if [ -z "$TRAVIS_TAG" ]
then
    echo "No tag present, do nothing"
    exit
fi

source travis/bump-versioncode.sh

if $(echo "$TRAVIS_TAG" | grep -q "beta")
then
    python3 assets/store_descriptions/generate_and_validate.py fdroidBeta
else
    python3 assets/store_descriptions/generate_and_validate.py fdroid
fi

set +e
retryCount=0
until curl https://api.github.com/repos/openhab/openhab-android/releases | jq -r '.[0].body' > fastlane/metadata/android/en-US/changelogs/${currentVersionCode}.txt
do
    let retryCount++
    if [ "$retryCount" -gt 20 ]
    then
        exit 1
    fi
    echo "Download failed. Retry"
    sleep 5
done

set -e

git config --local user.name "openhab-bot"
git config --local user.email "<EMAIL>"
echo "Git add"
git add fastlane/metadata/* "mobile/build.gradle"
echo "Git commit"
git commit -m "Bump version to $TRAVIS_TAG and update fastlane metadata"
echo "Git tag"
git tag -a "${TRAVIS_TAG}-fdroid" -m "${TRAVIS_TAG} for F-Droid"
echo "Git decrypt key"
openssl aes-256-cbc -K $encrypted_c0c05d762590_key -iv $encrypted_c0c05d762590_iv -in travis/key.enc -out travis/key -d > /dev/null 2>&1
echo "Copy ssh config"
cp travis/ssh-config ~/.ssh/config
echo "Change key permissions"
chmod 400 travis/key
echo "Git create master branch"
git checkout -b master
echo "Git add remote"
git remote add github <EMAIL>:openhab/openhab-android > /dev/null 2>&1
echo "Git fetch"
git fetch github > /dev/null 2>&1
{'fraction_non_alphanumeric': 0.1206405693950178, 'fraction_numerical': 0.026690391459074734, 'mean_word_length': 4.101633393829401, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4965647', 'n_tokens_mistral': 1085, 'n_tokens_neox': 1008, 'n_words': 305}