[tool.bumpversion]
current_version = "2.28.1"
commit = true
message = "Bump version: {current_version} → {new_version} [skip ci]"
tag = false
tag_name = "{new_version}"
allow_dirty = true
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = [
    "{major}.{minor}.{patch}",
]

[[tool.bumpversion.files]]
filename = "CHANGES.md"
search = """[Unreleased](https://github.com/bird-house/birdhouse-deploy/tree/master) (latest)
------------------------------------------------------------------------------------------------------------------"""
replace = """[Unreleased](https://github.com/bird-house/birdhouse-deploy/tree/master) (latest)
------------------------------------------------------------------------------------------------------------------

[//]: # (list changes here, using '-' for each new entry, remove this when items are added)

[{new_version}](https://github.com/bird-house/birdhouse-deploy/tree/{new_version}) ({utcnow:%Y-%m-%d})
------------------------------------------------------------------------------------------------------------------"""

[[tool.bumpversion.files]]
filename = "Makefile"
part = "version"
search = "APP_VERSION := {current_version}"
replace = "APP_VERSION := {new_version}"

[[tool.bumpversion.files]]
filename = "README.rst"
part = "version"
search = "{current_version}"
replace = "{new_version}"

[[tool.bumpversion.files]]
filename = "RELEASE.txt"
part = "version"
search = "{current_version}"
replace = "{new_version}"

[[tool.bumpversion.files]]
filename = "RELEASE.txt"
search = "\\d{{4}}-\\d{{2}}-\\d{{2}}T\\d{{2}}:\\d{{2}}:\\d{{2}}Z"
replace = "{utcnow:%Y-%m-%dT%H:%M:%SZ}"
regex = true

[[tool.bumpversion.files]]
filename = "birdhouse/components/canarie-api/docker_configuration.py.template"
part = "version"
search = "'version': '{current_version}'"
replace = "'version': '{new_version}'"

[[tool.bumpversion.files]]
filename = "birdhouse/components/canarie-api/docker_configuration.py.template"
search = "'releaseTime': '\\d{{4}}-\\d{{2}}-\\d{{2}}T\\d{{2}}:\\d{{2}}:\\d{{2}}Z'"
replace = "'releaseTime': '{utcnow:%Y-%m-%dT%H:%M:%SZ}'"
regex = true

[[tool.bumpversion.files]]
filename = "docs/source/conf.py"
part = "version"
search = "'{current_version}'"
replace = "'{new_version}'"
