mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-27 19:51:41 +00:00
Release management using CircleCI (#3498)
* Release management using CircleCI * Changelog updated
This commit is contained in:
committed by
Ismail Khoffi
parent
6c1a4b5137
commit
9199f3f613
37
scripts/release_management/bump-semver.py
Executable file
37
scripts/release_management/bump-semver.py
Executable file
@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Bump the release number of a semantic version number and print it. --version is required.
|
||||
# Version is
|
||||
# - vA.B.C, in which case vA.B.C+1 will be returned
|
||||
# - vA.B.C-devorwhatnot in which case vA.B.C will be returned
|
||||
# - vA.B in which case vA.B.0 will be returned
|
||||
|
||||
import re
|
||||
import argparse
|
||||
|
||||
|
||||
def semver(ver):
|
||||
if re.match('v[0-9]+\.[0-9]+',ver) is None:
|
||||
ver="v0.0"
|
||||
#raise argparse.ArgumentTypeError('--version must be a semantic version number with major, minor and patch numbers')
|
||||
return ver
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--version", help="Version number to bump, e.g.: v1.0.0", required=True, type=semver)
|
||||
args = parser.parse_args()
|
||||
|
||||
found = re.match('(v[0-9]+\.[0-9]+)(\.(.+))?', args.version)
|
||||
majorminorprefix = found.group(1)
|
||||
patch = found.group(3)
|
||||
if patch is None:
|
||||
patch = "0-new"
|
||||
|
||||
if re.match('[0-9]+$',patch) is None:
|
||||
patchfound = re.match('([0-9]+)',patch)
|
||||
patch = int(patchfound.group(1))
|
||||
else:
|
||||
patch = int(patch) + 1
|
||||
|
||||
print("{0}.{1}".format(majorminorprefix, patch))
|
Reference in New Issue
Block a user