[build] Use workflow_dispatch for release

This commit is contained in:
pukkandan 2021-11-29 22:35:23 +05:30
parent 13ab5fa586
commit 75b725a7cc
No known key found for this signature in database
GPG key ID: 0F00D95A001F4698
5 changed files with 36 additions and 21 deletions

View file

@ -1,5 +1,6 @@
#!/usr/bin/env python3
from datetime import datetime
import sys
import subprocess
@ -13,7 +14,10 @@ old_ver = '.'.join(old_version_list[:3])
old_rev = old_version_list[3] if len(old_version_list) > 3 else ''
ver = datetime.utcnow().strftime("%Y.%m.%d")
rev = str(int(old_rev or 0) + 1) if old_ver == ver else ''
rev = (sys.argv[1:] or [''])[0] # Use first argument, if present as revision number
if not rev:
rev = str(int(old_rev or 0) + 1) if old_ver == ver else ''
VERSION = '.'.join((ver, rev)) if rev else ver