---
# https://python-semantic-release.readthedocs.io/en/latest/
# yamllint disable rule:line-length

# Setup
# example of pyproject.toml
# [tool.poetry]
# name = "your_package"
# version = "0.1.0"  # this will be updated if fix, feat or breaking change
#
# [tool.semantic_release]
# # you can keep your version elsewhere if you prefer!
# version_variable = "pyproject.toml:version"
# build_command = "pip install poetry && poetry build"
# # https://python-semantic-release.readthedocs.io/en/latest/configuration.html#build-command

variables:
  BADGE_semantic_release: "version-${CI_COMMIT_TAG}-informational"
  BADGE_semantic_release_URL: "${CI_PROJECT_URL}/tags/${CI_COMMIT_TAG}"

.python:semantic-release:template:
  stage: .post
  image: registry.gitlab.com/notno/python-semantic-releaser
  variables:
    GIT_AUTHOR_NAME: python-semantic-release
    GIT_AUTHOR_EMAIL: bot@$CI_SERVER_HOST
    GIT_COMMITTER_NAME: release bot
    GIT_COMMITTER_EMAIL: bot@$CI_SERVER_HOST
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
    - if: $CI_COMMIT_TAG
      when: never
