<commit_before><commit_msg>release<commit_after>#!/bin/sh -ex

./gradlew -q clean test jar
./gradlew clean

git co master
git pull

VERSION="$1"
TAG_VERSION="${VERSION}.0"
BRANCH="release/$VERSION"

git co -b "$BRANCH"

git push origin "$BRANCH"

git tag "$TAG_VERSION"

git push origin "$TAG_VERSION"

RELEASE_BODY=$(cat <<EOF
{
  "tag_name": "$TAG_VERSION",
  "target_commitish": "$BRANCH",
  "name": "$TAG_VERSION",
  "body": "Release $TAG_VERSION",
  "draft": false,
  "prerelease": false
}
EOF
)

RELEASE_ID=$(oksocial -d "$RELEASE_BODY" https://api.github.com/repos/yschimke/oksocial-output/releases | jq .id)

echo Created "https://api.github.com/repos/yschimke/oksocial-output/releases/${RELEASE_ID}"

./gradlew -q clean jar

#./oksocial -H "Content-Type: application/x-gzip" -d "@build/distributions/oksocial-${TAG_VERSION}.tgz" "https://uploads.github.com/repos/yschimke/oksocial/releases/${RELEASE_ID}/assets?name=oksocial-${TAG_VERSION}.tgz" | jq ".browser_download_url"
{'fraction_non_alphanumeric': 0.17820773930753564, 'fraction_numerical': 0.002036659877800407, 'mean_word_length': 5.2215189873417724, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 3, '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': '2437049', 'n_tokens_mistral': 383, 'n_tokens_neox': 360, 'n_words': 70}