Skip to content

Commit

Permalink
Simplify version number and file name logic in build server (especial…
Browse files Browse the repository at this point in the history
…ly for releases)
  • Loading branch information
jonoomph committed Sep 22, 2018
1 parent f2fac8c commit 8b79f7f
Showing 1 changed file with 30 additions and 31 deletions.
61 changes: 30 additions & 31 deletions installer/build-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,37 +237,36 @@ def parse_version_info(version_path):
# Get GIT description of openshot-qt-git branch (i.e. v2.0.6-18-ga01a98c)
openshot_qt_git_desc = ""
needs_upload = True
for line in run_command("git describe --tags"):
git_description = line.decode("utf-8").strip()
openshot_qt_git_desc = "OpenShot-%s" % git_description

# Add num of commits from libopenshot and libopenshot-audio (for naming purposes)
# If not an official release
if git_branch_name == "develop":
# Make filename more descriptive for daily builds (add time epoch)
openshot_qt_git_desc = "OpenShot-v%s-%d" % (info.VERSION, int(time.time()))
openshot_qt_git_desc = "%s-%s-%s" % (openshot_qt_git_desc, version_info.get('libopenshot').get('CI_COMMIT_SHA')[:8], version_info.get('libopenshot-audio').get('CI_COMMIT_SHA')[:8])
# Get daily git_release object
github_release = get_release(repo, "daily")
elif git_branch_name == "release":
# Get daily git_release object
openshot_qt_git_desc = "OpenShot-v%s-release-candidate-%d" % (info.VERSION, int(time.time()))
github_release = get_release(repo, "daily")
elif git_branch_name == "master":
# Get official version release (i.e. v2.1.0, v2.x.x)
github_release = get_release(repo, git_description)

# If no release is found, create a new one
if not github_release:
# Create a new release if one if missing
github_release = repo.create_release(git_description, target_commitish="master", prerelease=True)
else:
# Make filename more descriptive for daily builds
openshot_qt_git_desc = "OpenShot-v%s-%d" % (info.VERSION, int(time.time()))
openshot_qt_git_desc = "%s-%s-%s" % (openshot_qt_git_desc, version_info.get('libopenshot').get('CI_COMMIT_SHA')[:8], version_info.get('libopenshot-audio').get('CI_COMMIT_SHA')[:8])
# Get daily git_release object
github_release = get_release(repo, "daily")
needs_upload = False

# Add num of commits from libopenshot and libopenshot-audio (for naming purposes)
# If not an official release
if git_branch_name == "develop":
# Make filename more descriptive for daily builds (add time epoch)
openshot_qt_git_desc = "OpenShot-v%s-%d" % (info.VERSION, int(time.time()))
openshot_qt_git_desc = "%s-%s-%s" % (openshot_qt_git_desc, version_info.get('libopenshot').get('CI_COMMIT_SHA')[:8], version_info.get('libopenshot-audio').get('CI_COMMIT_SHA')[:8])
# Get daily git_release object
github_release = get_release(repo, "daily")
elif git_branch_name == "release":
# Get daily git_release object
openshot_qt_git_desc = "OpenShot-v%s-release-candidate-%d" % (info.VERSION, int(time.time()))
github_release = get_release(repo, "daily")
elif git_branch_name == "master":
# Get official version release (i.e. v2.1.0, v2.x.x)
openshot_qt_git_desc = "OpenShot-v%s" % info.VERSION
github_release_name = "v%s" % info.VERSION
github_release = get_release(repo, github_release_name)

# If no release is found, create a new one
if not github_release:
# Create a new release if one if missing
github_release = repo.create_release(github_release_name, target_commitish="master", prerelease=True)
else:
# Make filename more descriptive for daily builds
openshot_qt_git_desc = "OpenShot-v%s-%d" % (info.VERSION, int(time.time()))
openshot_qt_git_desc = "%s-%s-%s" % (openshot_qt_git_desc, version_info.get('libopenshot').get('CI_COMMIT_SHA')[:8], version_info.get('libopenshot-audio').get('CI_COMMIT_SHA')[:8])
# Get daily git_release object
github_release = get_release(repo, "daily")
needs_upload = False

# Output git description
output("git description of openshot-qt-git: %s" % openshot_qt_git_desc)
Expand Down

0 comments on commit 8b79f7f

Please sign in to comment.