diff options
author | Eike Ziller <eike.ziller@qt.io> | 2021-12-14 11:17:48 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2022-01-10 13:44:40 +0000 |
commit | bc6b05497d900917714fb1f05b25268f6d427c3a (patch) | |
tree | 9fc58d6992bb64e17cc4fe0056c6b81f88a1eaf4 | |
parent | 695f254fac8231f2bf91b89e27020bfbcdeff022 (diff) |
Build.py/macOS: Add a signed bundle
If a signing identity is given, create a signed install, and zip it up
(if zip files are wanted).
Can be used to directly add a signed app to an installer.
Change-Id: Ib575d7c907eea74c247407107884f29a526d5d1c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
-rwxr-xr-x | scripts/build.py | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/scripts/build.py b/scripts/build.py index e723f101b3..0fa86da1aa 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -286,16 +286,30 @@ def package_qtcreator(args, paths): '*'], paths.qtcreatorcdbext_install) - if common.is_mac_platform() and not args.no_dmg and not args.no_qtcreator: + if common.is_mac_platform() and not args.no_qtcreator: if args.keychain_unlock_script: common.check_print_call([args.keychain_unlock_script], paths.install) - common.check_print_call(['python', '-u', - os.path.join(paths.src, 'scripts', 'makedmg.py'), - 'qt-creator' + args.zip_infix + '.dmg', - 'Qt Creator', - paths.src, - paths.install], - paths.result) + if os.environ.get('SIGNING_IDENTITY'): + signed_install_path = paths.install + '-signed' + common.copytree(paths.install, signed_install_path, symlinks=True) + apps = [d for d in os.listdir(signed_install_path) if d.endswith('.app')] + if apps: + app = apps[0] + common.codesign(os.path.join(signed_install_path, app)) + if not args.no_zip: + common.check_print_call(['7z', 'a', '-mmt' + args.zip_threads, + os.path.join(paths.result, 'qtcreator' + args.zip_infix + '-signed.7z'), + app], + signed_install_path) + if not args.no_dmg: + common.check_print_call(['python', '-u', + os.path.join(paths.src, 'scripts', 'makedmg.py'), + 'qt-creator' + args.zip_infix + '.dmg', + 'Qt Creator', + paths.src, + paths.install], + paths.result) + def get_paths(args): Paths = collections.namedtuple('Paths', |