refactor(build): unify SDK configuration and release tooling

Pin Flutter with FVM and share local environment loading across IDE, Python, and Dart entrypoints. Keep CI on the verified preinstalled SDK and skip local overrides.

Extract common build presets, process execution, and file hashing. Propagate project roots through SDK selection and release commands, and migrate macOS release, signing, and DMG orchestration to Python.

Reuse local check suites in CI, support Android source overrides, and update documentation and regression tests.
This commit is contained in:
lingjhf committed 2026-10-06 23:34:15 +08:00
1 parent a13a54d5ec
commit 0343e2f723
57 files changed
+1858 -375

No files matched your search

+11 -8
View File
@@ -6,11 +6,14 @@ from pathlib import Path
import plistlib
import re
import shutil
import subprocess
import sys
import tempfile
from urllib.parse import urlsplit
import xml.etree.ElementTree as ET
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from common.process import cli, run
SPARKLE = 'http://www.andymatuschak.org/xml-namespaces/sparkle'
@@ -65,10 +68,10 @@ def validate_app(app, local=False):
for file in ['Sparkle', 'Autoupdate', 'Updater.app/Contents/MacOS/Updater']:
if not (framework / file).is_file():
raise ValueError(f'Missing Sparkle component: {file}')
subprocess.run(['codesign', '--verify', '--deep', '--strict', str(app)], check=True)
run(['codesign', '--verify', '--deep', '--strict', str(app)], cwd=Path.cwd(), check=True)
if not local:
subprocess.run(['xcrun', 'stapler', 'validate', str(app)], check=True)
subprocess.run(['spctl', '--assess', '--type', 'execute', str(app)], check=True)
run(['xcrun', 'stapler', 'validate', str(app)], cwd=Path.cwd(), check=True)
run(['spctl', '--assess', '--type', 'execute', str(app)], cwd=Path.cwd(), check=True)
return info
@@ -108,14 +111,14 @@ def publish(app, output, base_url, tools, key_file=None, local=False):
raise ValueError(f'Refusing to replace published archive: {archive}')
with tempfile.TemporaryDirectory(prefix='cutdex-update-') as directory:
stage = Path(directory)
subprocess.run(['ditto', '-c', '-k', '--sequesterRsrc', '--keepParent',
str(app), str(stage / filename)], check=True)
run(['ditto', '-c', '-k', '--sequesterRsrc', '--keepParent',
str(app), str(stage / filename)], cwd=Path.cwd(), check=True)
command = [str(tools / 'generate_appcast'), '--maximum-deltas', '0',
'--download-url-prefix', base_url.rstrip('/') + '/',
'-o', str(stage / 'appcast.xml')]
if key_file:
command.extend(['--ed-key-file', str(key_file)])
subprocess.run([*command, str(stage)], check=True)
run([*command, str(stage)], cwd=Path.cwd(), check=True)
tree = ET.parse(stage / 'appcast.xml')
if tree.findall(f'.//{{{SPARKLE}}}deltas'):
raise ValueError('This release pipeline only permits full updates')
@@ -154,4 +157,4 @@ def main():
if __name__ == '__main__':
main()
sys.exit(cli(main))