<commit_before>#! /bin/bash

cd "$( dirname "${BASH_SOURCE[0]}" )"

echo "deploy-ios.sh"

# if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
#   echo "This is a pull request. No deployment will be done."
#   exit 0
# fi
# if [[ "$TRAVIS_BRANCH" != "master" ]]; then
#   echo "Testing on a branch other than master. No deployment will be done."
#   exit 0
# fi

export GITHUB_USER='JrGoodle'
export GITHUB_REPO='clowder'

cd "${TRAVIS_BUILD_DIR}"

echo 'Create source distribution'
echo '--------------------------'
python3 setup.py sdist
echo ''

echo 'Create wheel'
echo '------------'
python3 setup.py bdist_wheel

SETUP_PY="${TRAVIS_BUILD_DIR}/setup.py"
VERSION=$(awk "/version='/" "${SETUP_PY}" | sed -n -e "s/^.*version='//p" | tr -d "',")
echo "VERSION=${VERSION}"
TAG="v${VERSION}"

if git rev-list "${TAG}" >/dev/null; then
	echo "${TAG} tag exists."
else
    echo "${TAG} tag not found. Creating new tag and GitHub Release"
    # Create new tag
    git tag "${TAG}"
    git push origin "${TAG}"
    # Create new GitHub Release from tag
    github-release release \
        --tag "${TAG}" \
        --name "${TAG}" \
		--description "Release ${TAG}"

    cd "${TRAVIS_BUILD_DIR}/dist"

    artifacts=( "clowder-${VERSION}-py3-none-any.whl" \
                 "clowder-${VERSION}.tar.gz" )

    for artifact in "${artifacts[@]}"; do
        echo "Upload ${artifact} to GitHub Release"<commit_msg>Fetch latest tags before checking in deploy.sh script<commit_after>#! /bin/bash

cd "$( dirname "${BASH_SOURCE[0]}" )"

echo "deploy-ios.sh"

# if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
#   echo "This is a pull request. No deployment will be done."
#   exit 0
# fi
# if [[ "$TRAVIS_BRANCH" != "master" ]]; then
#   echo "Testing on a branch other than master. No deployment will be done."
#   exit 0
# fi

export GITHUB_USER='JrGoodle'
export GITHUB_REPO='clowder'

cd "${TRAVIS_BUILD_DIR}"

echo 'Create source distribution'
echo '--------------------------'
python3 setup.py sdist
echo ''

echo 'Create wheel'
echo '------------'
python3 setup.py bdist_wheel

SETUP_PY="${TRAVIS_BUILD_DIR}/setup.py"
VERSION=$(awk "/version='/" "${SETUP_PY}" | sed -n -e "s/^.*version='//p" | tr -d "',")
echo "VERSION=${VERSION}"
TAG="v${VERSION}"

git fetch --tags
if git rev-list "${TAG}" >/dev/null; then
	echo "${TAG} tag exists."
else
    echo "${TAG} tag not found. Creating new tag and GitHub Release"
    # Create new tag
    git tag "${TAG}"
    git push origin "${TAG}"
    # Create new GitHub Release from tag
    github-release release \
        --tag "${TAG}" \
        --name "${TAG}" \
		--description "Release ${TAG}"

    cd "${TRAVIS_BUILD_DIR}/dist"

    artifacts=( "clowder-${VERSION}-py3-none-any.whl" \
                 "clowder-${VERSION}.tar.gz" )

    for artifact in "${artifacts[@]}"; do
        echo "Upload ${artifact} to GitHub Release"
{'fraction_non_alphanumeric': 0.19594830597275584, 'fraction_numerical': 0.0041914076143905, 'mean_word_length': 2.955801104972376, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3346617', 'n_tokens_mistral': 991, 'n_tokens_neox': 956, 'n_words': 295}