From 1dad8b3aa28cf8d2c2e0d3baa523c0621f4d5627 Mon Sep 17 00:00:00 2001 From: Asher Baker Date: Thu, 14 Jan 2016 14:35:32 +0000 Subject: [PATCH] Include version number in package --- upload.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/upload.py b/upload.py index eb2cd3e..cc21c63 100644 --- a/upload.py +++ b/upload.py @@ -24,7 +24,19 @@ def GITVersion(): stdout = stdout.decode('UTF-8') return stdout.rstrip('\r\n') -filename = '-'.join(['accelerator', 'git' + GITVersion(), GITHash(), platform]) +def ReleaseVersion(): + productFile = open('../product.version', 'r') + productContents = productFile.read() + productFile.close() + + m = re.match('(\d+)\.(\d+)\.(\d+)(.*)', productContents) + if m == None: + raise Exception('Could not detremine product version') + + major, minor, release, tag = m.groups() + return '.'.join([major, minor, release]) + +filename = '-'.join(['accelerator', ReleaseVersion(), 'git' + GITVersion(), GITHash(), platform]) debug_build = os.environ.get('is_debug_build', False) == "1"