mirror of
https://github.com/zen-browser/desktop.git
synced 2026-04-21 14:55:37 +00:00
chore: Sync upstream Firefox to version 147.0, p=#11822
* chore: Sync upstream to `Firefox 147.0` * chore: Continued migration, b=no-bug, c=tests * chore: Finish migration without testing, b=no-bug, c=scripts, tabs, media, common, split-view * feat: Finish migration, b=no-bug, c=common, compact-mode, split-view, workspaces * feat: Finish basic migration, b=no-bug, c=kbs, common, folders * feat: Update surfer, b=no-bug, c=scripts
This commit is contained in:
@@ -10,9 +10,9 @@ import shutil
|
||||
from check_rc_response import get_rc_response, rc_should_be_updated
|
||||
|
||||
|
||||
def update_rc(last_version: str):
|
||||
rc_version = get_rc_response()
|
||||
if rc_should_be_updated(rc_version, last_version):
|
||||
def update_rc(last_version: str, last_build: int):
|
||||
rc_version, rc_build = get_rc_response()
|
||||
if rc_should_be_updated(rc_version, last_version, rc_build, last_build):
|
||||
print(f"New Firefox RC version is available: {rc_version}")
|
||||
print("Removing engine directory and updating surfer.json.")
|
||||
if os.path.exists("engine"):
|
||||
@@ -21,6 +21,7 @@ def update_rc(last_version: str):
|
||||
data = json.load(f)
|
||||
with open("surfer.json", "w") as f:
|
||||
data["version"]["candidate"] = rc_version
|
||||
data["version"]["candidateBuild"] = rc_build
|
||||
json.dump(data, f, indent=2)
|
||||
print("Download the new engine by running 'npm run download'.")
|
||||
os.system("npm run download")
|
||||
@@ -28,10 +29,10 @@ def update_rc(last_version: str):
|
||||
print("No new Firefox RC version available.")
|
||||
|
||||
|
||||
def update_ff(is_rc: bool = False, last_version: str = ""):
|
||||
def update_ff(is_rc: bool = False, last_version: str = "", last_build: int = 0):
|
||||
"""Runs the npm command to sync Firefox."""
|
||||
if is_rc:
|
||||
return update_rc(last_version)
|
||||
return update_rc(last_version, last_build)
|
||||
result = os.system("npm run sync:raw")
|
||||
if result != 0:
|
||||
raise RuntimeError("Failed to sync Firefox.")
|
||||
@@ -42,7 +43,8 @@ def get_version_from_file(filename, is_rc):
|
||||
try:
|
||||
with open(filename, "r") as f:
|
||||
data = json.load(f)
|
||||
return data["version"]["version"] if not is_rc else data["version"]["candidate"]
|
||||
return (data["version"]["version"] if not is_rc else data["version"]["candidate"],
|
||||
data["version"]["candidateBuild"])
|
||||
except (FileNotFoundError, json.JSONDecodeError) as e:
|
||||
raise RuntimeError(f"Error reading version from {filename}: {e}")
|
||||
|
||||
@@ -91,9 +93,9 @@ def main():
|
||||
|
||||
try:
|
||||
if not args.just_l10n:
|
||||
last_version = get_version_from_file("surfer.json", args.rc)
|
||||
update_ff(args.rc, last_version)
|
||||
new_version = get_version_from_file("surfer.json", args.rc)
|
||||
last_version, last_build = get_version_from_file("surfer.json", args.rc)
|
||||
update_ff(args.rc, last_version, last_build)
|
||||
new_version, new_build = get_version_from_file("surfer.json", args.rc)
|
||||
update_readme(last_version, new_version, args.rc)
|
||||
print(
|
||||
f"Updated version from {last_version} to {new_version} in README.md.")
|
||||
|
||||
Reference in New Issue
Block a user