From 9f439c6a4e8862cc3072b458a4c17bc098bb0e64 Mon Sep 17 00:00:00 2001 From: literat Date: Sun, 29 Jan 2023 22:00:14 +0100 Subject: [PATCH] Chore(ci): Make package version independently refs #37 * @see: https://github.com/lmc-eu/code-quality-tools/pull/113 * each package bumps its version base on conventional commits * conventional changelog can determine the package bump itself * lerna bumps package independently * and as we are using deprecations, this is another safe lock to not produce breaking changes --- Makefile | 3 +-- bin/ci/semver.sh | 33 --------------------------------- 2 files changed, 1 insertion(+), 35 deletions(-) delete mode 100755 bin/ci/semver.sh diff --git a/Makefile b/Makefile index 69e39d439b..2f01c1d95f 100644 --- a/Makefile +++ b/Makefile @@ -50,9 +50,8 @@ pristine: ## Remove all `node_modules` and files version: ## Create new version of packages # @see https://github.com/lerna/lerna/tree/main/commands/version#readme # Bump version of packages changed since the last release -# `./bin/ci/semver.sh` - determines semantic versioning keyword, e.g.: major, minor, patch # --yes` - skip all confirmation prompts - $(PKG_MANAGER) $(MONOREPO_TOOL) version $(shell ./bin/ci/semver.sh) --yes --no-push $(MONOREPO_TOOL_FLAGS) $(MONOREPO_TOOL_NO_PUSH) + $(PKG_MANAGER) $(MONOREPO_TOOL) version --yes --no-push $(MONOREPO_TOOL_FLAGS) $(MONOREPO_TOOL_NO_PUSH) publish: ## Publish packages to repository # @ee: https://github.com/lerna/lerna/tree/main/commands/publish#readme diff --git a/bin/ci/semver.sh b/bin/ci/semver.sh deleted file mode 100755 index 993e0f5c34..0000000000 --- a/bin/ci/semver.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -function grep_word_from_git_commits_since_last_tag() { - local commits=$(git log --oneline $(git describe --tags --abbrev=0 @^)..@ --grep="$1" 2> /dev/null) - - if [ $? -eq 128 ]; then - echo 2 - elif [ -z "$commits" ]; - then - echo 0 - else - echo 1 - fi -} - -function get_version() { - ## - # TODO: Comment out this code when packages are stable - # if [ `grep_word_from_git_commits_since_last_tag "BREAKING CHANGE"` -gt 0 ] - # then - # echo "major" - # elif [ `grep_word_from_git_commits_since_last_tag "Feat"` -gt 0 ] - # The packages are still unstable so we update only 0.x.x versions (minor and patch) - # however breaking changes are still documented in the changelog - if [ `grep_word_from_git_commits_since_last_tag "BREAKING CHANGE"` -gt 0 ] || [ `grep_word_from_git_commits_since_last_tag "Feat"` -gt 0 ] - then - echo "minor" - else - echo "patch" - fi -} - -get_version