<commit_before># This is a collection of internal targets implementing
# releasing new versions as git tags.
#
# ------------------------------------------------------------------------------

.PHONY: _publish
_publish: guard-env-GIT_REMOTE
	@$(ECHO_DO) "Publishing version..."
	$(GIT) push --no-verify $(GIT_REMOTE) v`$(CAT) "package.json" | $(JQ) -r ".version"`
	@$(ECHO_DONE)


.PHONY: _release
_release:
	@$(ECHO_DO) "Release new $(VSN) version..."
	# $(MAKE) nuke all test version/v$(VSN) _publish
	# no need for 'nuke all test'
	$(MAKE) check version/v$(VSN) _publish
	sleep 15 # allow CI to pick the new tag first
	$(GIT) fetch
#	if upstream diverged, create merge commit or else `git push` fails
	[[ `$(GIT) rev-list --count HEAD..@{u}` = 0 ]] || { \
		$(ECHO_INFO) "Upstream has new commits..."; \
		$(GIT) --no-pager log \
			--color \
			--graph \
			--date=short \<commit_msg>make sure deps are available when running 'make check' within 'make release'<commit_after># This is a collection of internal targets implementing
# releasing new versions as git tags.
#
# ------------------------------------------------------------------------------

.PHONY: _publish
_publish: guard-env-GIT_REMOTE
	@$(ECHO_DO) "Publishing version..."
	$(GIT) push --no-verify $(GIT_REMOTE) v`$(CAT) "package.json" | $(JQ) -r ".version"`
	@$(ECHO_DONE)


.PHONY: _release
_release:
	@$(ECHO_DO) "Release new $(VSN) version..."
	# $(MAKE) nuke all test version/v$(VSN) _publish
	# no need for 'nuke all test'
	$(MAKE) deps check version/v$(VSN) _publish
	sleep 15 # allow CI to pick the new tag first
	$(GIT) fetch
#	if upstream diverged, create merge commit or else `git push` fails
	[[ `$(GIT) rev-list --count HEAD..@{u}` = 0 ]] || { \
		$(ECHO_INFO) "Upstream has new commits..."; \
		$(GIT) --no-pager log \
			--color \
			--graph \
			--date=short \
{'fraction_non_alphanumeric': 0.23969631236442515, 'fraction_numerical': 0.0032537960954446853, 'mean_word_length': 2.4615384615384617, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1534791', 'n_tokens_mistral': 679, 'n_tokens_neox': 623, 'n_words': 202}