diff --git a/jobs/versioning.yml b/jobs/versioning.yml new file mode 100644 index 0000000000000000000000000000000000000000..542c0a3b781bda6ed375cd1517e5cefa7586240a --- /dev/null +++ b/jobs/versioning.yml @@ -0,0 +1,21 @@ +.versioning: + image: node:10-buster-slim + stage: version_control + rules: + - if: $CI_COMMIT_TAG + when: never + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + before_script: + - > + apt-get update && apt-get install -y --no-install-recommends + git-core ca-certificates tar + - npm install -g semantic-release @semantic-release/gitlab @semantic-release/changelog + script: + - VERSION_OLD=$(git tag --sort=committerdate | tail -1) + - semantic-release + - VERSION_NEW=$(git tag --sort=committerdate | tail -1) + - echo "VERSION_OLD=$VERSION_OLD" >> deploy.env + - echo "VERSION_NEW=$VERSION_NEW" >> deploy.env + artifacts: + reports: + dotenv: deploy.env