<commit_before># (c) <NAME>, <EMAIL>
#
# Variables:
ECHO_BIN ?= echo
SED_BIN ?= sed
PWD_BIN ?= pwd
BASENAME_BIN ?= basename
GIT_BIN ?= git

# -------------------------------------------------------------------------
# Set a default target
.MAIN: usage

DIR = $(shell ${PWD_BIN} -P)
SELF = $(shell ${BASENAME_BIN} ${DIR})
VER = $(shell ${SED_BIN} -n '1s/^[[:space:]]*//; 1s/[[:space:]]*$$//; 1p' ${DIR}/version)
VERSION ?= ${VER}
LAST_COMMIT = $(shell ${GIT_BIN} log -1 | sed -n '/^commit/s/^commit //p')

usage:
	@${ECHO_BIN} "Usage: make [target] ..."
	@${ECHO_BIN} ""
	@${ECHO_BIN} "Examples: make setver"
	@${ECHO_BIN} "          make VERSION=1.15.2 setver"
	@${ECHO_BIN} "          make settag"
	@${ECHO_BIN} "          make push"
	@${ECHO_BIN} "          make deploy"
	@${ECHO_BIN} ""
	@${ECHO_BIN} "Description:"
	@${ECHO_BIN} "  setver         Set a new version (is taken from environment or file)."
	@${ECHO_BIN} "  settag         Set a new version as a tag to the last commit."
	@${ECHO_BIN} "  push           Push to the repo (with tags)."
	@${ECHO_BIN} "  deploy         Set a tag (version file) and push to the repo."
	@${ECHO_BIN} ""

setver:
	@${ECHO_BIN} "Setting version to ${VERSION}"
	@${SED_BIN} -i "s/# Version: .*$$/# Version: ${VERSION}/" ${DIR}/README.md
	@${SED_BIN} -i "s/# Version: .*$$/# Version: ${VERSION}/" ${DIR}/trc
	@${SED_BIN} -i "1s/.*/${VERSION}/" ${DIR}/version

settag:
	@${ECHO_BIN} "Setting ${VERSION} as a tag to ${LAST_COMMIT}"
	@${GIT_BIN} tag ${VERSION} ${LAST_COMMIT} 2>/dev/null || true

push:
	@${ECHO_BIN} "Pushing commits..."
	@${GIT_BIN} push origin
	@${ECHO_BIN} "Pushing tags..."
	@${GIT_BIN} push origin ${VERSION}

cideploy: setver settag
	@${GIT_BIN} add .
	@${GIT_BIN} ci -m "Deploy new version: ${VERSION}"

deploy: cideploy push<commit_msg>Renamed deploy make's targer to release<commit_after># (c) <NAME>, <EMAIL>
#
# Variables:
ECHO_BIN ?= echo
SED_BIN ?= sed
PWD_BIN ?= pwd
BASENAME_BIN ?= basename
GIT_BIN ?= git

# -------------------------------------------------------------------------
# Set a default target
.MAIN: usage

DIR = $(shell ${PWD_BIN} -P)
SELF = $(shell ${BASENAME_BIN} ${DIR})
VER = $(shell ${SED_BIN} -n '1s/^[[:space:]]*//; 1s/[[:space:]]*$$//; 1p' ${DIR}/version)
VERSION ?= ${VER}
LAST_COMMIT = $(shell ${GIT_BIN} log -1 | sed -n '/^commit/s/^commit //p')

usage:
	@${ECHO_BIN} "Usage: make [target] ..."
	@${ECHO_BIN} ""
	@${ECHO_BIN} "Examples: make setver"
	@${ECHO_BIN} "          make VERSION=1.15.2 setver"
	@${ECHO_BIN} "          make settag"
	@${ECHO_BIN} "          make push"
	@${ECHO_BIN} "          make release"
	@${ECHO_BIN} "          make VERSION=1.1.14 release"
	@${ECHO_BIN} ""
	@${ECHO_BIN} "Description:"
	@${ECHO_BIN} "  setver         Set a new version (is taken from environment or file)."
	@${ECHO_BIN} "  settag         Set a new version as a tag to the last commit."
	@${ECHO_BIN} "  push           Push to the repo (with tags)."
	@${ECHO_BIN} "  release        Set a version, tag and push to the repo."
	@${ECHO_BIN} ""

setver:
	@${ECHO_BIN} "Setting version to ${VERSION}"
	@${SED_BIN} -i "s/# Version: .*$$/# Version: ${VERSION}/" ${DIR}/README.md
	@${SED_BIN} -i "s/# Version: .*$$/# Version: ${VERSION}/" ${DIR}/trc
	@${SED_BIN} -i "1s/.*/${VERSION}/" ${DIR}/version

settag:
	@${ECHO_BIN} "Setting ${VERSION} as a tag to ${LAST_COMMIT}"
	@${GIT_BIN} tag ${VERSION} ${LAST_COMMIT} 2>/dev/null || true

push:
	@${ECHO_BIN} "Pushing commits..."
	@${GIT_BIN} push origin
	@${ECHO_BIN} "Pushing tags..."
	@${GIT_BIN} push origin ${VERSION}

cirelease: setver settag
	@${GIT_BIN} add .
	@${GIT_BIN} ci -m "Release new version: ${VERSION}"

release: cirelease push
{'fraction_non_alphanumeric': 0.24408163265306124, 'fraction_numerical': 0.006530612244897959, 'mean_word_length': 2.9484425349087005, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '149960', 'n_tokens_mistral': 1516, 'n_tokens_neox': 1456, 'n_words': 383}