refactor(build): unify SDK configuration and release tooling
Gitea CI / Check code and tests (pull_request) Failing after 8m56s
Gitea CI / Build Android APK (pull_request) Skipped
Gitea CI / Build Windows x64 app (pull_request) Skipped
Gitea CI / Audit and package Windows x64 (pull_request) Skipped
Gitea CI / Assemble and validate CI artifacts (pull_request) Skipped
Gitea CI / Gitea CI passed (pull_request) Failing after 4s

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 22:24:32 +08:00
1 parent ca2efdaf18
commit 152c051a29
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))