bakdata / ci-templates

Collection of reusable workflows and composite actions for Github
MIT License
4 stars 1 forks source link

Remove semver bumping from release-tag-version workflow #90

Open yannick-roeder opened 1 year ago

yannick-roeder commented 1 year ago

We should be able to use this configuration for bumpversion to properly work with a -snapshot suffix without the need for semver:

[bumpversion]
current_version = 0.2.2-snapshot
search = version: {current_version}
replace = version: {new_version}
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(-(?P<release>snapshot))?
serialize = 
    {major}.{minor}.{patch}-{release}
    {major}.{minor}.{patch}

[bumpversion:part:release]
first_value = snapshot
optional_value = release
values = 
    snapshot
    release

Then bumpversion release always removes the suffix and bumpversion major, bumpversion minor and bumpversion patch always add it. In order to do a major or minor release 2 bumpversion commands can be chained then:

bumpversion release
bumpversion major/bumpversion minor