#!/usr/bin/env sh

set -eux

# If there is a change in version number, add a git tag
PROJECT_VERSION_OLD="$(git grep "version" HEAD~1:pyproject.toml | cut -d '"' -f 2)"
PROJECT_VERSION_NEW="$(grep "version" pyproject.toml | cut -d '"' -f 2)"

if [ "${PROJECT_VERSION_NEW}" != "${PROJECT_VERSION_OLD}" ]; then
  git tag -s ${PROJECT_VERSION_NEW} -m "Automatic release"
fi
