fix(ci): package saved Windows builds without Flutter resolution
Gitea CI / Check code and tests (pull_request) Failing after 5m36s
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 1s
Gitea CI / Check code and tests (pull_request) Failing after 5m36s
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 1s
This commit is contained in:
1 parent
e9d04bea2c
commit
8377e17ef1
5 files changed
+54
-9
No files matched your search
@@ -15,6 +15,9 @@ from check_windows_release import audit
|
||||
from update_versions import numeric_version, update_version
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
SDK_VERSION = '1.2.161'
|
||||
|
||||
|
||||
def resolved_deskup():
|
||||
config = ROOT / '.dart_tool/package_config.json'
|
||||
if not config.is_file():
|
||||
@@ -27,12 +30,13 @@ def resolved_deskup():
|
||||
return Path(url2pathname(uri.path))
|
||||
|
||||
|
||||
DESKUP_ROOT = resolved_deskup()
|
||||
DESKUP_VERSION = re.search(r'^version: ([^\s]+)',
|
||||
(DESKUP_ROOT / 'pubspec.yaml').read_text(encoding='utf-8'),
|
||||
re.MULTILINE).group(1)
|
||||
SDK_VERSION = re.search(r'set\(DESKUP_VELOPACK_VERSION "([^"]+)"\)',
|
||||
(DESKUP_ROOT / 'windows/velopack.cmake').read_text(encoding='utf-8')).group(1)
|
||||
def verify_sdk_version():
|
||||
"""Validate the resolved build SDK before saving the app for later packaging."""
|
||||
cmake = (resolved_deskup() / 'windows/velopack.cmake').read_text(encoding='utf-8')
|
||||
match = re.search(r'set\(DESKUP_VELOPACK_VERSION "([^"]+)"\)', cmake)
|
||||
if not match or match[1] != SDK_VERSION:
|
||||
raise ValueError(f'Resolved deskup must use Velopack SDK {SDK_VERSION}')
|
||||
return SDK_VERSION
|
||||
|
||||
|
||||
def vpk_command(path):
|
||||
@@ -145,6 +149,7 @@ def serve(directory, port):
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
commands = parser.add_subparsers(dest='command', required=True)
|
||||
commands.add_parser('verify-sdk', help='Verify resolved native SDK before saving a build')
|
||||
pack = commands.add_parser('pack', help='Package a complete audited release; never uploads')
|
||||
pack.add_argument('--app', type=Path, required=True)
|
||||
pack.add_argument('--output', type=Path, required=True)
|
||||
@@ -156,8 +161,11 @@ def main():
|
||||
args = parser.parse_args()
|
||||
try:
|
||||
if args.command == 'pack':
|
||||
verify_sdk_version()
|
||||
print(json.dumps(package_app(args.app, args.output, args.vpk,
|
||||
development=args.development)))
|
||||
elif args.command == 'verify-sdk':
|
||||
print(f'Velopack SDK {verify_sdk_version()} verified')
|
||||
else:
|
||||
serve(args.directory, args.port)
|
||||
except KeyboardInterrupt:
|
||||
|
||||
Reference in new issue
Block a user