From ce60b83e657eb337b99a7ecedb80d3803d9bd92f Mon Sep 17 00:00:00 2001 From: Semyon Bezrukov Date: Wed, 8 Feb 2023 11:27:22 +0300 Subject: [PATCH 1/7] Update win appcast generation (#619) --- scripts/package_branding.py | 3 ++ scripts/package_desktop.py | 104 +++++++++++++++++++----------------- 2 files changed, 57 insertions(+), 50 deletions(-) diff --git a/scripts/package_branding.py b/scripts/package_branding.py index 0726d89..9f8f5b1 100644 --- a/scripts/package_branding.py +++ b/scripts/package_branding.py @@ -11,6 +11,7 @@ cert_name = "Ascensio System SIA" s3_bucket = "repo-doc-onlyoffice-com" s3_region = "eu-west-1" +s3_base_url = "https://s3.eu-west-1.amazonaws.com/repo-doc-onlyoffice-com" if utils.is_windows(): desktop_product_name = "Desktop Editors" @@ -21,6 +22,8 @@ if utils.is_windows(): "en": "changes", "ru": "changes_ru" } + desktop_changes_url = "https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/changes" + desktop_updates_url = "https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/updates" if utils.is_macos(): desktop_package_name = "ONLYOFFICE" diff --git a/scripts/package_desktop.py b/scripts/package_desktop.py index e1d3bcd..d79cd68 100644 --- a/scripts/package_desktop.py +++ b/scripts/package_desktop.py @@ -117,7 +117,7 @@ def make_windows(): make_inno_update() if common.platform == "windows_x64": - make_winsparkle_files() + make_update_files() if common.platform in ["windows_x64", "windows_x86"]: make_advinst() @@ -229,7 +229,7 @@ def make_inno_help(): def make_inno_update(): utils.log_h2("desktop inno update build") - utils.log_h2(inno_update_file) + utils.log_h3(inno_update_file) args = ["iscc"] + iscc_args + ["/DTARGET_NAME=" + inno_file, "update_common.iss"] ret = utils.cmd(*args, creates=inno_update_file, verbose=True) @@ -245,64 +245,68 @@ def make_inno_update(): utils.set_summary("desktop inno update deploy", ret) return -def make_winsparkle_files(): - utils.log_h2("desktop winsparkle files build") +def make_update_files(): + utils.log_h2("desktop update files build") if branding.onlyoffice: - awk_branding = "update/branding.awk" + changes_dir = "update\\changes\\" + common.version else: - awk_branding = "../../../../" + common.branding + \ - "/desktop-apps/win-linux/package/windows/update/branding.awk" - awk_args = [ - "-v", "Version=" + common.version, - "-v", "Build=" + common.build, - "-v", "Branch=" + common.channel, - "-v", "Timestamp=" + common.timestamp, - "-i", awk_branding + changes_dir = "..\\..\\..\\..\\" + common.branding + "\\desktop-apps\\" + \ + "win-linux\\package\\windows\\update\\changes\\" + common.version + for lang, base in branding.desktop_update_changes_list.items(): + utils.log_h3("changes " + lang + " html") + utils.copy_file(changes_dir + "\\" + lang + ".html", "update\\" + base + ".html") + + appcast_args = [ + "-Version", package_version, + "-Timestamp", common.timestamp + ] + if branding.onlyoffice: + appcast_args.append("-Multilang") + appcast_prod_args = [ + "-UpdatesUrlPrefix", branding.desktop_updates_url, + "-ReleaseNotesUrlPrefix", branding.desktop_changes_url + ] + appcast_test_base_url = "%s/win/inno/%s/%s" % (branding.s3_base_url, common.version, common.build) + appcast_test_args = [ + "-UpdatesUrlPrefix", appcast_test_base_url, + "-ReleaseNotesUrlPrefix", appcast_test_base_url ] - appcast = "update/appcast.xml" - utils.log_h3(appcast) - args = ["env", "LANG=en_US.UTF-8", "awk", "-v", "Prod=1"] + \ - awk_args + ["-f", "update/appcast.xml.awk"] - appcast_result = utils.cmd_output(*args, verbose=True) - utils.write_file(appcast, appcast_result) - - appcast_test = "update/appcast-test.xml" - utils.log_h3(appcast_test) - args = ["env", "LANG=en_US.UTF-8", "awk"] + \ - awk_args + ["-f", "update/appcast.xml.awk"] - appcast_result = utils.cmd_output(*args, verbose=True) - utils.write_file(appcast_test, appcast_result) - - if branding.onlyoffice: - changes_dir = "update/changes/" + common.version - else: - changes_dir = "../../../../" + common.branding + \ - "/desktop-apps/win-linux/package/windows/update/changes/" + common.version - for lang, base in branding.desktop_update_changes_list.items(): - changes = "update/%s.html" % base - if lang == "en": encoding = "en_US.UTF-8" - elif lang == "ru": encoding = "ru_RU.UTF-8" - utils.log_h3(changes) - changes_file = "%s/%s.html" % (changes_dir, lang) - args = ["env", "LANG=" + encoding, "awk"] + awk_args + \ - ["-f", "update/changes.html.awk", changes_file] - - if utils.is_exist(changes_file): - changes_result = utils.cmd_output(*args, verbose=True) - utils.write_file(changes, changes_result) - else: - utils.log("! file not exist: " + changes_file) + utils.log_h3("appcast prod json") + utils.ps1( + "update\\make_appcast.ps1", + appcast_args + appcast_prod_args, + creates="update\\appcast.json", verbose=True + ) + utils.log_h3("appcast prod xml") + utils.ps1( + "update\\make_appcast_xml.ps1", + appcast_args + appcast_prod_args, + creates="update\\appcast.xml", verbose=True + ) + utils.log_h3("appcast test json") + utils.ps1( + "update\\make_appcast.ps1", + appcast_args + appcast_test_args + ["-OutFile", "appcast-test.json"], + creates="update\\appcast-test.json", verbose=True + ) + utils.log_h3("appcast test xml") + utils.ps1( + "update\\make_appcast_xml.ps1", + appcast_args + appcast_test_args + ["-OutFile", "appcast-test.xml"], + creates="update\\appcast-test.xml", verbose=True + ) if common.deploy: - utils.log_h2("desktop winsparkle files deploy") + utils.log_h2("desktop update files deploy") ret = aws_s3_upload( - utils.glob_path("update/*.xml") + utils.glob_path("update/*.html"), + utils.glob_path("update/*.json") + utils.glob_path("update/*.xml") + \ + utils.glob_path("update/*.html"), "win/inno/%s/%s/" % (common.version, common.build), - "WinSparkle" + "Update" ) - utils.set_summary("desktop winsparkle files deploy", ret) + utils.set_summary("desktop update files deploy", ret) return def make_advinst(): From b7aa164ed84197ec7907398f486f7f083d43ef83 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 8 Feb 2023 08:35:15 +0000 Subject: [PATCH 2/7] Update hard-coded version to v7.3.3 --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 643916c..44e98ad 100644 --- a/version +++ b/version @@ -1 +1 @@ -7.3.1 +7.3.3 From 1a70ce90f9f8fc566d9bb255000ea94f46ab5d85 Mon Sep 17 00:00:00 2001 From: Semyon Bezrukov Date: Fri, 10 Feb 2023 15:34:31 +0300 Subject: [PATCH 3/7] Allow 32-bit msi only on 32-bit system (#621) --- scripts/package_desktop.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/package_desktop.py b/scripts/package_desktop.py index d79cd68..7779471 100644 --- a/scripts/package_desktop.py +++ b/scripts/package_desktop.py @@ -342,18 +342,23 @@ def make_advinst(): aic_content += [ "ResetSig" ] - if arch == "x86": - aic_content += [ - "SetPackageType x86", - "SetAppdir -buildname DefaultBuild -path [ProgramFilesFolder][MANUFACTURER_INSTALL_FOLDER]\\[PRODUCT_INSTALL_FOLDER]", - 'DelPrerequisite "Microsoft Visual C++ 2015-2022 Redistributable (x64)"', - 'DelPrerequisite "Microsoft Visual C++ 2013 Redistributable (x64)"' - ] if arch == "x64": aic_content += [ + "SetPackageType x64 -buildname DefaultBuild", + "AddOsLc -buildname DefaultBuild -arch x64", + "DelOsLc -buildname DefaultBuild -arch x86", 'DelPrerequisite "Microsoft Visual C++ 2015-2022 Redistributable (x86)"', 'DelPrerequisite "Microsoft Visual C++ 2013 Redistributable (x86)"' ] + if arch == "x86": + aic_content += [ + "SetPackageType x86 -buildname DefaultBuild", + "AddOsLc -arch x86 -buildname DefaultBuild", + "DelOsLc -arch x64 -buildname DefaultBuild", + "SetAppdir -path [ProgramFilesFolder][MANUFACTURER_INSTALL_FOLDER]\\[PRODUCT_INSTALL_FOLDER] -buildname DefaultBuild", + 'DelPrerequisite "Microsoft Visual C++ 2015-2022 Redistributable (x64)"', + 'DelPrerequisite "Microsoft Visual C++ 2013 Redistributable (x64)"' + ] if branding.onlyoffice: aic_content += [ "DelFolder CUSTOM_PATH" @@ -382,7 +387,6 @@ def make_advinst(): "SetProperty ASCC_REG_PREFIX=" + branding.ascc_reg_prefix ] aic_content += [ - "AddOsLc -buildname DefaultBuild -arch " + arch, "SetCurrentFeature MainFeature", "NewSync APPDIR " + source_dir, "UpdateFile APPDIR\\DesktopEditors.exe " + source_dir + "\\DesktopEditors.exe", From 65ef84179f54cf6b5fcf94453fe8a42a1e6e2275 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 8 Feb 2023 08:35:15 +0000 Subject: [PATCH 4/7] Update hard-coded version to v7.3.3 (cherry picked from commit b7aa164ed84197ec7907398f486f7f083d43ef83) --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index eab246c..44e98ad 100644 --- a/version +++ b/version @@ -1 +1 @@ -7.3.2 +7.3.3 From 6c2ce95b0e77790656216afdcf45750d92d3cdb6 Mon Sep 17 00:00:00 2001 From: Semyon Bezrukov Date: Tue, 14 Feb 2023 19:19:24 +0300 Subject: [PATCH 5/7] Fix test appcast links (#626) --- scripts/package_desktop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/package_desktop.py b/scripts/package_desktop.py index 7779471..1ae3053 100644 --- a/scripts/package_desktop.py +++ b/scripts/package_desktop.py @@ -267,7 +267,7 @@ def make_update_files(): "-UpdatesUrlPrefix", branding.desktop_updates_url, "-ReleaseNotesUrlPrefix", branding.desktop_changes_url ] - appcast_test_base_url = "%s/win/inno/%s/%s" % (branding.s3_base_url, common.version, common.build) + appcast_test_base_url = "%s/desktop/win/inno/%s/%s" % (branding.s3_base_url, common.version, common.build) appcast_test_args = [ "-UpdatesUrlPrefix", appcast_test_base_url, "-ReleaseNotesUrlPrefix", appcast_test_base_url From 228b00d5c757376661103ad7a0e8cd80eb139714 Mon Sep 17 00:00:00 2001 From: Semyon Bezrukov Date: Thu, 16 Feb 2023 15:44:19 +0300 Subject: [PATCH 6/7] Setting up Info.plist version (#627) * Setting up Info.plist version * Small fix --- scripts/package_desktop.py | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/scripts/package_desktop.py b/scripts/package_desktop.py index 1ae3053..34df026 100644 --- a/scripts/package_desktop.py +++ b/scripts/package_desktop.py @@ -432,41 +432,37 @@ def make_macos(): utils.set_cwd(branding_dir) if common.clean: - utils.log("\n=== Clean\n") + utils.log_h2("clean") utils.delete_dir(utils.get_env("HOME") + "/Library/Developer/Xcode/Archives") utils.delete_dir(utils.get_env("HOME") + "/Library/Caches/Sparkle_generate_appcast") - plist_path = "%s/%s/ONLYOFFICE/Resources/%s-%s/Info.plist" \ - % (common.workspace_dir, branding.desktop_branding_dir, branding.desktop_package_name, suffix) - current_version = utils.sh_output( - '/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" ' + plist_path, - verbose=True).rstrip() - current_build = utils.sh_output( - '/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" ' + plist_path, - verbose=True).rstrip() - app_version = current_version - appcast_url = branding.sparkle_base_url + "/" + suffix + "/" + branding.desktop_package_name.lower() + ".xml" - release_version = utils.sh_output( + release_bundle_version_string = utils.sh_output( 'curl -Ls ' + appcast_url + ' 2> /dev/null' \ + ' | xmllint --xpath "/rss/channel/item[1]/enclosure/@*[name()=\'sparkle:shortVersionString\']" -' \ + ' | cut -f2 -d\\\"', verbose=True).rstrip() - release_build = utils.sh_output( + release_bundle_version = utils.sh_output( 'curl -Ls ' + appcast_url + ' 2> /dev/null' \ + ' | xmllint --xpath "/rss/channel/item[1]/enclosure/@*[name()=\'sparkle:version\']" -' \ + ' | cut -f2 -d\\\"', verbose=True).rstrip() - utils.log("CURRENT=" + current_version + "(" + current_build + ")" \ - + "\nRELEASE=" + release_version + "(" + release_build + ")") + app_version = common.version + bundle_version = str(int(release_bundle_version) + 1) + plist_path = "%s/%s/ONLYOFFICE/Resources/%s-%s/Info.plist" \ + % (common.workspace_dir, branding.desktop_branding_dir, branding.desktop_package_name, suffix) + utils.sh('/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString %s" %s' \ + % (common.version, plist_path), verbose=True) + utils.sh('/usr/libexec/PlistBuddy -c "Set :CFBundleVersion %s" %s' \ + % (bundle_version, plist_path), verbose=True) + + utils.log("RELEASE=" + release_bundle_version_string + "(" + release_bundle_version + ")" \ + + "\nCURRENT=" + common.version + "(" + bundle_version + ")") dmg = make_dmg() if dmg: - if int(current_build) > int(release_build): - make_sparkle_updates() - else: - utils.log(release_build + " <= " + current_build) + make_sparkle_updates() utils.set_cwd(common.workspace_dir) return From 05902d88a7ad471121af41c8331e9657c804d10d Mon Sep 17 00:00:00 2001 From: Semyon Bezrukov Date: Fri, 17 Feb 2023 18:07:25 +0300 Subject: [PATCH 7/7] Update vcredist checksums (#628) --- scripts/package_common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/package_common.py b/scripts/package_common.py index 84203c7..f480baf 100644 --- a/scripts/package_common.py +++ b/scripts/package_common.py @@ -19,11 +19,11 @@ vcredist_links = { "2022": { "x64": { "url": "https://aka.ms/vs/17/release/vc_redist.x64.exe", - "md5": "703bd677778f2a1ba1eb4338bac3b868" + "md5": "119dde89a20674349a51893114eae5ed" }, "x86": { "url": "https://aka.ms/vs/17/release/vc_redist.x86.exe", - "md5": "732d0ac9cd31b8136f1c8e72efec1636" + "md5": "ca8c521c30f57c0c199d526b9a23fc4a" } }, "2015": {