Modified update paths and files in order to deploy the next date based release

This commit is contained in:
Manuel Cortez 2020-07-27 09:39:54 -05:00
parent 1477522681
commit fd791fe181
3 changed files with 17 additions and 13 deletions

View File

@ -1,8 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys
python_version = int(sys.version[0])
name = "MusicDL" name = "MusicDL"
version = "0.7"
author = "Manuel Cortéz" author = "Manuel Cortéz"
authorEmail = "manuel@manuelcortez.net" authorEmail = "manuel@manuelcortez.net"
copyright = "Copyright (C) 2019-2020, Manuel Cortez" copyright = "Copyright (C) 2019-2020, Manuel Cortez"
@ -14,6 +11,6 @@ translators = [_(u"Manuel Cortez (Spanish)")]
bts_name = "music_dl" bts_name = "music_dl"
bts_access_token = "fe3j2ijirvevv9" bts_access_token = "fe3j2ijirvevv9"
bts_url = "https://issues.manuelcortez.net" bts_url = "https://issues.manuelcortez.net"
update_stable_url = "https://manuelcortez.net/static/files/music_dl/update/stable.json" update_url = "https://manuelcortez.net/static/files/music_dl/update/latest.json"
update_next_url = "https://manuelcortez.net/static/files/music_dl/update/alpha.json" version = "2020.07.23"
update_next_version=None update_next_version = "14775226"

View File

@ -12,12 +12,8 @@ def do_update(update_type="alpha"):
# Updates cannot be performed in the source code version. # Updates cannot be performed in the source code version.
if hasattr(sys, "frozen") == False: if hasattr(sys, "frozen") == False:
return return
if update_type == "stable": endpoint = application.update_url
endpoint = application.update_stable_url version = application.update_next_version
version = application.version
else:
endpoint = application.update_next_url
version = application.update_next_version
try: try:
return update.perform_update(endpoint=endpoint, current_version=version, app_name=application.name, update_type=update_type, update_available_callback=available_update_dialog, progress_callback=progress_callback, update_complete_callback=update_finished) return update.perform_update(endpoint=endpoint, current_version=version, app_name=application.name, update_type=update_type, update_available_callback=available_update_dialog, progress_callback=progress_callback, update_complete_callback=update_finished)
except ConnectionError: except ConnectionError:

View File

@ -11,9 +11,20 @@ commit = commit_info["short_id"]
print("Got new version info: {commit}".format(commit=commit,)) print("Got new version info: {commit}".format(commit=commit,))
file = open("application.py", "r", encoding="utf-8") file = open("application.py", "r", encoding="utf-8")
lines = file.readlines() lines = file.readlines()
lines[-2] = 'version = "{}"\n'.format(commit_info["created_at"][:10].replace("-", "."))
lines[-1] = 'update_next_version = "{commit}"'.format(commit=commit,) lines[-1] = 'update_next_version = "{commit}"'.format(commit=commit,)
file.close() file.close()
file2 = open("application.py", "w", encoding="utf-8") file2 = open("application.py", "w", encoding="utf-8")
file2.writelines(lines) file2.writelines(lines)
file2.close() file2.close()
print("Wrote application.py with the new version info.") print("Wrote application.py with the new version info.")
print("Updating next version on installer setup...")
file = open("installer.nsi", "r", encoding="utf-8")
contents = file.read()
contents = contents.replace("0.7", commit_info["created_at"][:10].replace("-", "."))
file.close()
file2 = open("installer.nsi", "w", encoding="utf-8")
file2.write(contents)
file2.close()
print("done")