add: semverbot config with auto git tag

This commit is contained in:
Mohamed Sohail 2021-10-05 09:16:00 +03:00
parent 68184c6e00
commit df1c38a6f0
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
3 changed files with 19 additions and 15 deletions

View File

@ -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

View File

@ -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"]

View File

@ -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