Skip to content

Commit

Permalink
Fix version setting for Forwarder in release.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bernd committed May 6, 2024
1 parent 75864ae commit 41a070d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions release.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,19 @@
print(f'Bumping {args.bump} to {args.version}')

# 6.0-alpha.1-1 => version="6.0", suffixes=["alpha.1", "1"]
# 6.0 => version="6.0", suffixes=[]
# 6.0-1 => version="6.0", suffixes=["1"]
version, *suffixes = args.version.split('-', 2)
suffix = suffixes[0] if len(suffixes) > 0 else None
release = suffixes[1] if len(suffixes) > 1 else 1

suffix = None
release = None
if len(suffixes) == 0:
raise RuntimeError("Missing revision suffix!")
elif len(suffixes) > 1:
suffix = suffixes[0]
release = suffixes[1]
else:
suffix = None
release = suffixes[0]

version_parsed[args.bump]['version'] = f'{version}-{suffix}' if suffix else version
version_parsed[args.bump]['release'] = int(release)
Expand Down

0 comments on commit 41a070d

Please sign in to comment.