From df1c38a6f07df4bb96064d666b6effe4e89a9dd1 Mon Sep 17 00:00:00 2001 From: Mohammed Sohail Date: Tue, 5 Oct 2021 09:16:00 +0300 Subject: [PATCH] add: semverbot config with auto git tag --- .gitlab-ci.yml | 19 ++++++++++++------- .semverbot.toml | 13 ++++++------- scripts/build-push.sh | 2 +- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9e023e8d..54087347 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,13 +33,18 @@ build-push: #script: # - TAG=$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA sh ./scripts/build-push.sh script: - - mkdir bin - - curl -o bin/sbot -L https://github.com/restechnica/semverbot/releases/download/v$SEMVERBOT_VERSION/sbot-linux-amd64 - - chmod +x bin/sbot - - echo "RELEASE_VERSION=$(bin/sbot predict version)" - - bin/sbot release version - - bin/sbot push version - - TAG=RELEASE_VERSION sh ./scripts/build-push.sh + - apk update && apk add git + - git remote remove origin + - git remote add origin https://kamikazechaser:$CI_TOKEN@gitlab.com/$CI_PROJECT_PATH + - curl -o sbot -L https://github.com/restechnica/semverbot/releases/download/v$SEMVERBOT_VERSION/sbot-linux-amd64 + - chmod +x sbot + - ./sbot predict version -m git-commit + - export TAG=$(./sbot predict version) + - TAG=$TAG sh ./scripts/build.sh + - TAG=$TAG sh ./scripts/build-push.sh + - TAG=latest sh ./scripts/build-push.sh + - git tag -a v$TAG -m "ci tagged" + - git push origin v$TAG rules: - if: $CI_COMMIT_REF_PROTECTED == "true" when: always diff --git a/.semverbot.toml b/.semverbot.toml index a50b2e03..69047e84 100644 --- a/.semverbot.toml +++ b/.semverbot.toml @@ -1,17 +1,16 @@ [git] [git.config] -email = "semverbot@github.com" -name = "semverbot" +email = "sohailsameja@gmail.com" +name = "kamikazechaser" [git.tags] prefix = "v" [semver] -mode = "auto" +mode = "git-commit" [semver.detection] -patch = ["fix:", "[fix]"] -minor = ["feat:", "[feat]"] -major = ["release:", "[release]", "BREAKING CHANGE:"] - +patch = ["fix", "[fix]", "patch", "[patch]"] +minor = ["minor", "[minor]", "feat", "[feat]", "release", "[release]", "bump", "[bump]"] +major = ["BREAKING CHANGE"] diff --git a/scripts/build-push.sh b/scripts/build-push.sh index 141a9e6c..c18dfa11 100755 --- a/scripts/build-push.sh +++ b/scripts/build-push.sh @@ -4,6 +4,6 @@ set -e TAG=${TAG?Variable not set} \ -sh ./scripts/build.sh +# sh ./scripts/build.sh docker-compose -f docker-compose.yml push