mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Update build scripts
This commit is contained in:
parent
806009315a
commit
e72c5174b8
@ -18,7 +18,7 @@ internal:
|
|||||||
except:
|
except:
|
||||||
- tags
|
- tags
|
||||||
script:
|
script:
|
||||||
- PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="$TELEGRAM_PRIVATE_DATA_PATH/build-configurations/enterprise-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=enterprise --configuration=release_arm64
|
- python3 -u build-system/Make/Make.py remote-build --darwinContainers="$DARWIN_CONTAINERS" --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="$TELEGRAM_PRIVATE_DATA_PATH/build-configurations/enterprise-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=enterprise --configuration=release_arm64
|
||||||
- python3 -u build-system/Make/DeployToAppCenter.py --configuration="$TELEGRAM_PRIVATE_DATA_PATH/appcenter-configurations/appcenter-internal.json" --ipa="build/artifacts/Telegram.ipa" --dsyms="build/artifacts/Telegram.DSYMs.zip"
|
- python3 -u build-system/Make/DeployToAppCenter.py --configuration="$TELEGRAM_PRIVATE_DATA_PATH/appcenter-configurations/appcenter-internal.json" --ipa="build/artifacts/Telegram.ipa" --dsyms="build/artifacts/Telegram.DSYMs.zip"
|
||||||
environment:
|
environment:
|
||||||
name: internal
|
name: internal
|
||||||
@ -37,7 +37,7 @@ appstore_development:
|
|||||||
except:
|
except:
|
||||||
- tags
|
- tags
|
||||||
script:
|
script:
|
||||||
- PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="$TELEGRAM_PRIVATE_DATA_PATH/build-configurations/enterprise-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=enterprise --configuration=release_arm64
|
- python3 -u build-system/Make/Make.py remote-build --darwinContainers="$DARWIN_CONTAINERS" --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="$TELEGRAM_PRIVATE_DATA_PATH/build-configurations/enterprise-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=enterprise --configuration=release_arm64
|
||||||
- python3 -u build-system/Make/DeployToAppCenter.py --configuration="$TELEGRAM_PRIVATE_DATA_PATH/appcenter-configurations/appstore-development.json" --ipa="build/artifacts/Telegram.ipa" --dsyms="build/artifacts/Telegram.DSYMs.zip"
|
- python3 -u build-system/Make/DeployToAppCenter.py --configuration="$TELEGRAM_PRIVATE_DATA_PATH/appcenter-configurations/appstore-development.json" --ipa="build/artifacts/Telegram.ipa" --dsyms="build/artifacts/Telegram.DSYMs.zip"
|
||||||
environment:
|
environment:
|
||||||
name: appstore-development
|
name: appstore-development
|
||||||
@ -55,7 +55,7 @@ experimental_i:
|
|||||||
except:
|
except:
|
||||||
- tags
|
- tags
|
||||||
script:
|
script:
|
||||||
- PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="$TELEGRAM_PRIVATE_DATA_PATH/build-configurations/enterprise-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=enterprise --configuration=release_arm64
|
- python3 -u build-system/Make/Make.py remote-build --darwinContainers="$DARWIN_CONTAINERS" --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="$TELEGRAM_PRIVATE_DATA_PATH/build-configurations/enterprise-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=enterprise --configuration=release_arm64
|
||||||
- python3 -u build-system/Make/DeployToAppCenter.py --configuration="$TELEGRAM_PRIVATE_DATA_PATH/appcenter-configurations/appcenter-experimental.json" --ipa="build/artifacts/Telegram.ipa" --dsyms="build/artifacts/Telegram.DSYMs.zip"
|
- python3 -u build-system/Make/DeployToAppCenter.py --configuration="$TELEGRAM_PRIVATE_DATA_PATH/appcenter-configurations/appcenter-experimental.json" --ipa="build/artifacts/Telegram.ipa" --dsyms="build/artifacts/Telegram.DSYMs.zip"
|
||||||
environment:
|
environment:
|
||||||
name: experimental
|
name: experimental
|
||||||
@ -73,7 +73,7 @@ experimental:
|
|||||||
except:
|
except:
|
||||||
- tags
|
- tags
|
||||||
script:
|
script:
|
||||||
- PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="$TELEGRAM_PRIVATE_DATA_PATH/build-configurations/enterprise-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=enterprise --configuration=release_arm64
|
- python3 -u build-system/Make/Make.py remote-build --darwinContainers="$DARWIN_CONTAINERS" --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="$TELEGRAM_PRIVATE_DATA_PATH/build-configurations/enterprise-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=enterprise --configuration=release_arm64
|
||||||
- python3 -u build-system/Make/DeployToAppCenter.py --configuration="$TELEGRAM_PRIVATE_DATA_PATH/appcenter-configurations/appcenter-experimental2.json" --ipa="build/artifacts/Telegram.ipa" --dsyms="build/artifacts/Telegram.DSYMs.zip"
|
- python3 -u build-system/Make/DeployToAppCenter.py --configuration="$TELEGRAM_PRIVATE_DATA_PATH/appcenter-configurations/appcenter-experimental2.json" --ipa="build/artifacts/Telegram.ipa" --dsyms="build/artifacts/Telegram.DSYMs.zip"
|
||||||
environment:
|
environment:
|
||||||
name: experimental-2
|
name: experimental-2
|
||||||
@ -92,7 +92,7 @@ beta_testflight:
|
|||||||
except:
|
except:
|
||||||
- tags
|
- tags
|
||||||
script:
|
script:
|
||||||
- PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="build-system/appstore-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=appstore --configuration=release_arm64
|
- python3 -u build-system/Make/Make.py remote-build --darwinContainers="$DARWIN_CONTAINERS" --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="build-system/appstore-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=appstore --configuration=release_arm64
|
||||||
environment:
|
environment:
|
||||||
name: testflight_llc
|
name: testflight_llc
|
||||||
artifacts:
|
artifacts:
|
||||||
@ -110,7 +110,7 @@ deploy_beta_testflight:
|
|||||||
except:
|
except:
|
||||||
- tags
|
- tags
|
||||||
script:
|
script:
|
||||||
- PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-deploy-testflight --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --ipa="build/artifacts/Telegram.ipa" --dsyms="build/artifacts/Telegram.DSYMs.zip"
|
- python3 -u build-system/Make/Make.py remote-deploy-testflight --darwinContainers="$DARWIN_CONTAINERS" --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --ipa="build/artifacts/Telegram.ipa" --dsyms="build/artifacts/Telegram.DSYMs.zip"
|
||||||
environment:
|
environment:
|
||||||
name: testflight_llc
|
name: testflight_llc
|
||||||
|
|
||||||
@ -125,8 +125,8 @@ verifysanity_beta_testflight:
|
|||||||
- tags
|
- tags
|
||||||
script:
|
script:
|
||||||
- rm -rf build/verify-input && mkdir -p build/verify-input && mv build/artifacts/Telegram.ipa build/verify-input/TelegramVerifySource.ipa
|
- rm -rf build/verify-input && mkdir -p build/verify-input && mv build/artifacts/Telegram.ipa build/verify-input/TelegramVerifySource.ipa
|
||||||
- PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="build-system/appstore-configuration.json" --codesigningInformationPath=build-system/fake-codesigning --configuration=release_arm64
|
- python3 -u build-system/Make/Make.py remote-build --darwinContainers="$DARWIN_CONTAINERS" --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="build-system/appstore-configuration.json" --codesigningInformationPath=build-system/fake-codesigning --configuration=release_arm64
|
||||||
- PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-ipa-diff --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --ipa1="build/artifacts/Telegram.ipa" --ipa2="build/verify-input/TelegramVerifySource.ipa"
|
- python3 -u build-system/Make/Make.py remote-ipa-diff --darwinContainers="$DARWIN_CONTAINERS" --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --ipa1="build/artifacts/Telegram.ipa" --ipa2="build/verify-input/TelegramVerifySource.ipa"
|
||||||
- if [ $? -ne 0 ]; then echo "Verification failed"; mkdir -p build/verifysanity_artifacts; cp build/artifacts/Telegram.ipa build/verifysanity_artifacts/; exit 1; fi
|
- if [ $? -ne 0 ]; then echo "Verification failed"; mkdir -p build/verifysanity_artifacts; cp build/artifacts/Telegram.ipa build/verifysanity_artifacts/; exit 1; fi
|
||||||
environment:
|
environment:
|
||||||
name: testflight_llc
|
name: testflight_llc
|
||||||
@ -147,8 +147,8 @@ verify_beta_testflight:
|
|||||||
- tags
|
- tags
|
||||||
script:
|
script:
|
||||||
- rm -rf build/verify-input && mkdir -p build/verify-input && mv build/artifacts/Telegram.ipa build/verify-input/TelegramVerifySource.ipa
|
- rm -rf build/verify-input && mkdir -p build/verify-input && mv build/artifacts/Telegram.ipa build/verify-input/TelegramVerifySource.ipa
|
||||||
- PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --configurationPath="build-system/appstore-configuration.json" --codesigningInformationPath=build-system/fake-codesigning --configuration=release_arm64
|
- python3 -u build-system/Make/Make.py remote-build --darwinContainers="$DARWIN_CONTAINERS" --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --configurationPath="build-system/appstore-configuration.json" --codesigningInformationPath=build-system/fake-codesigning --configuration=release_arm64
|
||||||
- PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-ipa-diff --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --ipa1="build/artifacts/Telegram.ipa" --ipa2="build/verify-input/TelegramVerifySource.ipa"
|
- python3 -u build-system/Make/Make.py remote-ipa-diff --darwinContainers="$DARWIN_CONTAINERS" --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --ipa1="build/artifacts/Telegram.ipa" --ipa2="build/verify-input/TelegramVerifySource.ipa"
|
||||||
- if [ $? -ne 0 ]; then echo "Verification failed"; mkdir -p build/verify_artifacts; cp build/artifacts/Telegram.ipa build/verify_artifacts/; exit 1; fi
|
- if [ $? -ne 0 ]; then echo "Verification failed"; mkdir -p build/verify_artifacts; cp build/artifacts/Telegram.ipa build/verify_artifacts/; exit 1; fi
|
||||||
environment:
|
environment:
|
||||||
name: testflight_llc
|
name: testflight_llc
|
||||||
|
44
build-system/Make/GenerateProfiles.py
Normal file
44
build-system/Make/GenerateProfiles.py
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import json
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import shutil
|
||||||
|
import tempfile
|
||||||
|
import plistlib
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
from BuildEnvironment import run_executable_with_output, check_run_system
|
||||||
|
|
||||||
|
|
||||||
|
def get_certificate_base64():
|
||||||
|
certificate_data = run_executable_with_output('security', arguments=['find-certificate', '-c', 'Apple Distribution: Telegram FZ-LLC (C67CF9S4VU)', '-p'])
|
||||||
|
certificate_data = certificate_data.replace('-----BEGIN CERTIFICATE-----', '')
|
||||||
|
certificate_data = certificate_data.replace('-----END CERTIFICATE-----', '')
|
||||||
|
certificate_data = certificate_data.replace('\n', '')
|
||||||
|
return certificate_data
|
||||||
|
|
||||||
|
|
||||||
|
def process_provisioning_profile(source, destination, certificate_data):
|
||||||
|
parsed_plist = run_executable_with_output('security', arguments=['cms', '-D', '-i', source], check_result=True)
|
||||||
|
parsed_plist_file = tempfile.mktemp()
|
||||||
|
with open(parsed_plist_file, 'w+') as file:
|
||||||
|
file.write(parsed_plist)
|
||||||
|
|
||||||
|
run_executable_with_output('plutil', arguments=['-remove', 'DeveloperCertificates.0', parsed_plist_file])
|
||||||
|
run_executable_with_output('plutil', arguments=['-insert', 'DeveloperCertificates.0', '-data', certificate_data, parsed_plist_file])
|
||||||
|
run_executable_with_output('plutil', arguments=['-remove', 'DER-Encoded-Profile', parsed_plist_file])
|
||||||
|
|
||||||
|
run_executable_with_output('security', arguments=['cms', '-S', '-N', 'Apple Distribution: Telegram FZ-LLC (C67CF9S4VU)', '-i', parsed_plist_file, '-o', destination])
|
||||||
|
|
||||||
|
os.unlink(parsed_plist_file)
|
||||||
|
|
||||||
|
|
||||||
|
def generate_provisioning_profiles(source_path, destination_path):
|
||||||
|
certificate_data = get_certificate_base64()
|
||||||
|
|
||||||
|
if not os.path.exists(destination_path):
|
||||||
|
print('{} does not exits'.format(destination_path))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
for file_name in os.listdir(source_path):
|
||||||
|
if file_name.endswith('.mobileprovision'):
|
||||||
|
process_provisioning_profile(source=source_path + '/' + file_name, destination=destination_path + '/' + file_name, certificate_data=certificate_data)
|
@ -14,6 +14,7 @@ from ProjectGeneration import generate
|
|||||||
from BazelLocation import locate_bazel
|
from BazelLocation import locate_bazel
|
||||||
from BuildConfiguration import CodesigningSource, GitCodesigningSource, DirectoryCodesigningSource, BuildConfiguration, build_configuration_from_json
|
from BuildConfiguration import CodesigningSource, GitCodesigningSource, DirectoryCodesigningSource, BuildConfiguration, build_configuration_from_json
|
||||||
import RemoteBuild
|
import RemoteBuild
|
||||||
|
import GenerateProfiles
|
||||||
|
|
||||||
|
|
||||||
class ResolvedCodesigningData:
|
class ResolvedCodesigningData:
|
||||||
@ -920,6 +921,12 @@ if __name__ == '__main__':
|
|||||||
type=str,
|
type=str,
|
||||||
help='DarwinContainers host address.'
|
help='DarwinContainers host address.'
|
||||||
)
|
)
|
||||||
|
remote_build_parser.add_argument(
|
||||||
|
'--darwinContainers',
|
||||||
|
required=True,
|
||||||
|
type=str,
|
||||||
|
help='DarwinContainers script path.'
|
||||||
|
)
|
||||||
remote_build_parser.add_argument(
|
remote_build_parser.add_argument(
|
||||||
'--configuration',
|
'--configuration',
|
||||||
choices=[
|
choices=[
|
||||||
@ -940,6 +947,15 @@ if __name__ == '__main__':
|
|||||||
help='Bazel remote cache host address.'
|
help='Bazel remote cache host address.'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
generate_profiles_build_parser = subparsers.add_parser('generate-verification-profiles', help='Generate provisioning profiles that can be used to build a veritication IPA.')
|
||||||
|
add_codesigning_common_arguments(generate_profiles_build_parser)
|
||||||
|
generate_profiles_build_parser.add_argument(
|
||||||
|
'--destination',
|
||||||
|
required=True,
|
||||||
|
type=str,
|
||||||
|
help='Path to the destination directory.'
|
||||||
|
)
|
||||||
|
|
||||||
remote_upload_testflight_parser = subparsers.add_parser('remote-deploy-testflight', help='Build the app using a remote environment.')
|
remote_upload_testflight_parser = subparsers.add_parser('remote-deploy-testflight', help='Build the app using a remote environment.')
|
||||||
remote_upload_testflight_parser.add_argument(
|
remote_upload_testflight_parser.add_argument(
|
||||||
'--darwinContainersHost',
|
'--darwinContainersHost',
|
||||||
@ -947,6 +963,12 @@ if __name__ == '__main__':
|
|||||||
type=str,
|
type=str,
|
||||||
help='DarwinContainers host address.'
|
help='DarwinContainers host address.'
|
||||||
)
|
)
|
||||||
|
remote_upload_testflight_parser.add_argument(
|
||||||
|
'--darwinContainers',
|
||||||
|
required=True,
|
||||||
|
type=str,
|
||||||
|
help='DarwinContainers script path.'
|
||||||
|
)
|
||||||
remote_upload_testflight_parser.add_argument(
|
remote_upload_testflight_parser.add_argument(
|
||||||
'--ipa',
|
'--ipa',
|
||||||
required=True,
|
required=True,
|
||||||
@ -967,6 +989,12 @@ if __name__ == '__main__':
|
|||||||
type=str,
|
type=str,
|
||||||
help='DarwinContainers host address.'
|
help='DarwinContainers host address.'
|
||||||
)
|
)
|
||||||
|
remote_ipadiff_parser.add_argument(
|
||||||
|
'--darwinContainers',
|
||||||
|
required=True,
|
||||||
|
type=str,
|
||||||
|
help='DarwinContainers script path.'
|
||||||
|
)
|
||||||
remote_ipadiff_parser.add_argument(
|
remote_ipadiff_parser.add_argument(
|
||||||
'--ipa1',
|
'--ipa1',
|
||||||
required=True,
|
required=True,
|
||||||
@ -1024,11 +1052,33 @@ if __name__ == '__main__':
|
|||||||
shutil.copyfile(args.configurationPath, remote_input_path + '/configuration.json')
|
shutil.copyfile(args.configurationPath, remote_input_path + '/configuration.json')
|
||||||
|
|
||||||
RemoteBuild.remote_build(
|
RemoteBuild.remote_build(
|
||||||
|
darwin_containers_path=args.darwinContainers,
|
||||||
darwin_containers_host=args.darwinContainersHost,
|
darwin_containers_host=args.darwinContainersHost,
|
||||||
bazel_cache_host=args.cacheHost,
|
bazel_cache_host=args.cacheHost,
|
||||||
configuration=args.configuration,
|
configuration=args.configuration,
|
||||||
build_input_data_path=remote_input_path
|
build_input_data_path=remote_input_path
|
||||||
)
|
)
|
||||||
|
elif args.commandName == 'generate-verification-profiles':
|
||||||
|
base_path = os.getcwd()
|
||||||
|
remote_input_path = '{}/build-input/remote-input'.format(base_path)
|
||||||
|
if os.path.exists(remote_input_path):
|
||||||
|
shutil.rmtree(remote_input_path)
|
||||||
|
os.makedirs(remote_input_path)
|
||||||
|
os.makedirs(remote_input_path + '/certs')
|
||||||
|
os.makedirs(remote_input_path + '/profiles')
|
||||||
|
|
||||||
|
if os.path.exists(args.destination):
|
||||||
|
shutil.rmtree(args.destination)
|
||||||
|
os.makedirs(args.destination)
|
||||||
|
|
||||||
|
resolve_configuration(
|
||||||
|
base_path=os.getcwd(),
|
||||||
|
bazel_command_line=None,
|
||||||
|
arguments=args,
|
||||||
|
additional_codesigning_output_path=remote_input_path
|
||||||
|
)
|
||||||
|
|
||||||
|
GenerateProfiles.generate_provisioning_profiles(source_path=remote_input_path + '/profiles', destination_path=args.destination)
|
||||||
elif args.commandName == 'remote-deploy-testflight':
|
elif args.commandName == 'remote-deploy-testflight':
|
||||||
env = os.environ
|
env = os.environ
|
||||||
if 'APPSTORE_CONNECT_USERNAME' not in env:
|
if 'APPSTORE_CONNECT_USERNAME' not in env:
|
||||||
@ -1039,6 +1089,7 @@ if __name__ == '__main__':
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
RemoteBuild.remote_deploy_testflight(
|
RemoteBuild.remote_deploy_testflight(
|
||||||
|
darwin_containers_path=args.darwinContainers,
|
||||||
darwin_containers_host=args.darwinContainersHost,
|
darwin_containers_host=args.darwinContainersHost,
|
||||||
ipa_path=args.ipa,
|
ipa_path=args.ipa,
|
||||||
dsyms_path=args.dsyms,
|
dsyms_path=args.dsyms,
|
||||||
@ -1047,6 +1098,7 @@ if __name__ == '__main__':
|
|||||||
)
|
)
|
||||||
elif args.commandName == 'remote-ipa-diff':
|
elif args.commandName == 'remote-ipa-diff':
|
||||||
RemoteBuild.remote_ipa_diff(
|
RemoteBuild.remote_ipa_diff(
|
||||||
|
darwin_containers_path=args.darwinContainers,
|
||||||
darwin_containers_host=args.darwinContainersHost,
|
darwin_containers_host=args.darwinContainersHost,
|
||||||
ipa1_path=args.ipa1,
|
ipa1_path=args.ipa1,
|
||||||
ipa2_path=args.ipa2
|
ipa2_path=args.ipa2
|
||||||
|
@ -4,41 +4,61 @@ import json
|
|||||||
import shutil
|
import shutil
|
||||||
import shlex
|
import shlex
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import importlib.util
|
||||||
|
from importlib.machinery import SourceFileLoader
|
||||||
|
|
||||||
from BuildEnvironment import run_executable_with_output
|
from BuildEnvironment import run_executable_with_output
|
||||||
|
|
||||||
|
|
||||||
|
def import_module_from_file(module_name, file_path):
|
||||||
|
if not os.path.exists(file_path):
|
||||||
|
print('{} does not exist'.format(file_path))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
loader = SourceFileLoader(module_name, file_path)
|
||||||
|
spec = importlib.util.spec_from_file_location(module_name, loader=loader)
|
||||||
|
module = importlib.util.module_from_spec(spec)
|
||||||
|
|
||||||
|
sys.modules[module_name] = module
|
||||||
|
spec.loader.exec_module(module)
|
||||||
|
return module
|
||||||
|
|
||||||
|
|
||||||
def session_scp_upload(session, source_path, destination_path):
|
def session_scp_upload(session, source_path, destination_path):
|
||||||
scp_command = 'scp -i {privateKeyPath} -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -pr {source_path} containerhost@"{ipAddress}":{destination_path}'.format(
|
scp_command = 'scp -i {privateKeyPath} -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -pr {source_path} containerhost@"{ipAddress}":{destination_path}'.format(
|
||||||
privateKeyPath=session.privateKeyPath,
|
privateKeyPath=session.private_key_path,
|
||||||
ipAddress=session.ipAddress,
|
ipAddress=session.ip_address,
|
||||||
source_path=shlex.quote(source_path),
|
source_path=shlex.quote(source_path),
|
||||||
destination_path=shlex.quote(destination_path)
|
destination_path=shlex.quote(destination_path)
|
||||||
)
|
)
|
||||||
if os.system(scp_command) != 0:
|
if os.system(scp_command) != 0:
|
||||||
print('Command {} finished with a non-zero status'.format(scp_command))
|
print('Command {} finished with a non-zero status'.format(scp_command))
|
||||||
|
|
||||||
|
|
||||||
def session_scp_download(session, source_path, destination_path):
|
def session_scp_download(session, source_path, destination_path):
|
||||||
scp_command = 'scp -i {privateKeyPath} -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -pr containerhost@"{ipAddress}":{source_path} {destination_path}'.format(
|
scp_command = 'scp -i {privateKeyPath} -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -pr containerhost@"{ipAddress}":{source_path} {destination_path}'.format(
|
||||||
privateKeyPath=session.privateKeyPath,
|
privateKeyPath=session.private_key_path,
|
||||||
ipAddress=session.ipAddress,
|
ipAddress=session.ip_address,
|
||||||
source_path=shlex.quote(source_path),
|
source_path=shlex.quote(source_path),
|
||||||
destination_path=shlex.quote(destination_path)
|
destination_path=shlex.quote(destination_path)
|
||||||
)
|
)
|
||||||
if os.system(scp_command) != 0:
|
if os.system(scp_command) != 0:
|
||||||
print('Command {} finished with a non-zero status'.format(scp_command))
|
print('Command {} finished with a non-zero status'.format(scp_command))
|
||||||
|
|
||||||
|
|
||||||
def session_ssh(session, command):
|
def session_ssh(session, command):
|
||||||
ssh_command = 'ssh -i {privateKeyPath} -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null containerhost@"{ipAddress}" -o ServerAliveInterval=60 -t "{command}"'.format(
|
ssh_command = 'ssh -i {privateKeyPath} -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null containerhost@"{ipAddress}" -o ServerAliveInterval=60 -t "{command}"'.format(
|
||||||
privateKeyPath=session.privateKeyPath,
|
privateKeyPath=session.private_key_path,
|
||||||
ipAddress=session.ipAddress,
|
ipAddress=session.ip_address,
|
||||||
command=command
|
command=command
|
||||||
)
|
)
|
||||||
return os.system(ssh_command)
|
return os.system(ssh_command)
|
||||||
|
|
||||||
def remote_build(darwin_containers_host, bazel_cache_host, configuration, build_input_data_path):
|
|
||||||
macos_version = '12.5'
|
|
||||||
|
|
||||||
from darwin_containers import DarwinContainers
|
def remote_build(darwin_containers_path, darwin_containers_host, bazel_cache_host, configuration, build_input_data_path):
|
||||||
|
macos_version = '13.0'
|
||||||
|
|
||||||
|
DarwinContainers = import_module_from_file('darwin-containers', darwin_containers_path)
|
||||||
|
|
||||||
base_dir = os.getcwd()
|
base_dir = os.getcwd()
|
||||||
|
|
||||||
@ -83,11 +103,12 @@ def remote_build(darwin_containers_host, bazel_cache_host, configuration, build_
|
|||||||
print('Compressing source code...')
|
print('Compressing source code...')
|
||||||
os.system('find . -type f -a -not -regex "\\." -a -not -regex ".*\\./git" -a -not -regex ".*\\./git/.*" -a -not -regex "\\./bazel-bin" -a -not -regex "\\./bazel-bin/.*" -a -not -regex "\\./bazel-out" -a -not -regex "\\./bazel-out/.*" -a -not -regex "\\./bazel-testlogs" -a -not -regex "\\./bazel-testlogs/.*" -a -not -regex "\\./bazel-telegram-ios" -a -not -regex "\\./bazel-telegram-ios/.*" -a -not -regex "\\./buildbox" -a -not -regex "\\./buildbox/.*" -a -not -regex "\\./buck-out" -a -not -regex "\\./buck-out/.*" -a -not -regex "\\./\\.buckd" -a -not -regex "\\./\\.buckd/.*" -a -not -regex "\\./build" -a -not -regex "\\./build/.*" -print0 | tar cf "{buildbox_dir}/transient-data/source.tar" --null -T -'.format(buildbox_dir=buildbox_dir))
|
os.system('find . -type f -a -not -regex "\\." -a -not -regex ".*\\./git" -a -not -regex ".*\\./git/.*" -a -not -regex "\\./bazel-bin" -a -not -regex "\\./bazel-bin/.*" -a -not -regex "\\./bazel-out" -a -not -regex "\\./bazel-out/.*" -a -not -regex "\\./bazel-testlogs" -a -not -regex "\\./bazel-testlogs/.*" -a -not -regex "\\./bazel-telegram-ios" -a -not -regex "\\./bazel-telegram-ios/.*" -a -not -regex "\\./buildbox" -a -not -regex "\\./buildbox/.*" -a -not -regex "\\./buck-out" -a -not -regex "\\./buck-out/.*" -a -not -regex "\\./\\.buckd" -a -not -regex "\\./\\.buckd/.*" -a -not -regex "\\./build" -a -not -regex "\\./build/.*" -print0 | tar cf "{buildbox_dir}/transient-data/source.tar" --null -T -'.format(buildbox_dir=buildbox_dir))
|
||||||
|
|
||||||
darwinContainers = DarwinContainers(serverAddress=darwin_containers_host, verbose=False)
|
|
||||||
|
|
||||||
print('Opening container session...')
|
print('Opening container session...')
|
||||||
with darwinContainers.workingImageSession(name=image_name) as session:
|
|
||||||
|
def handle_ssh_credentials(credentials):
|
||||||
|
with DarwinContainers.ContainerSession(credentials=credentials) as session:
|
||||||
print('Uploading data to container...')
|
print('Uploading data to container...')
|
||||||
|
|
||||||
session_scp_upload(session=session, source_path=build_input_data_path, destination_path='telegram-build-input')
|
session_scp_upload(session=session, source_path=build_input_data_path, destination_path='telegram-build-input')
|
||||||
session_scp_upload(session=session, source_path='{base_dir}/{buildbox_dir}/transient-data/source.tar'.format(base_dir=base_dir, buildbox_dir=buildbox_dir), destination_path='')
|
session_scp_upload(session=session, source_path='{base_dir}/{buildbox_dir}/transient-data/source.tar'.format(base_dir=base_dir, buildbox_dir=buildbox_dir), destination_path='')
|
||||||
|
|
||||||
@ -136,14 +157,34 @@ def remote_build(darwin_containers_host, bazel_cache_host, configuration, build_
|
|||||||
|
|
||||||
if os.path.exists(artifacts_path + '/Telegram.ipa'):
|
if os.path.exists(artifacts_path + '/Telegram.ipa'):
|
||||||
print('Artifacts have been stored at {}'.format(artifacts_path))
|
print('Artifacts have been stored at {}'.format(artifacts_path))
|
||||||
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
print('Telegram.ipa not found')
|
print('Telegram.ipa not found')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def remote_deploy_testflight(darwin_containers_host, ipa_path, dsyms_path, username, password):
|
DarwinContainers.run_remote_ssh(credentials=credentials, command='')
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
def handle_stopped():
|
||||||
|
pass
|
||||||
|
|
||||||
|
DarwinContainers.DarwinContainers(
|
||||||
|
server_address=darwin_containers_host,
|
||||||
|
verbose=False
|
||||||
|
).run_image(
|
||||||
|
name=image_name,
|
||||||
|
is_base=False,
|
||||||
|
is_gui=True,
|
||||||
|
is_daemon=False,
|
||||||
|
on_ssh_credentials=handle_ssh_credentials,
|
||||||
|
on_stopped=handle_stopped
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def remote_deploy_testflight(darwin_containers_path, darwin_containers_host, ipa_path, dsyms_path, username, password):
|
||||||
macos_version = '12.5'
|
macos_version = '12.5'
|
||||||
|
|
||||||
from darwin_containers import DarwinContainers
|
DarwinContainers = import_module_from_file('darwin-containers', darwin_containers_path)
|
||||||
|
|
||||||
configuration_path = 'versions.json'
|
configuration_path = 'versions.json'
|
||||||
xcode_version = ''
|
xcode_version = ''
|
||||||
@ -159,10 +200,9 @@ def remote_deploy_testflight(darwin_containers_host, ipa_path, dsyms_path, usern
|
|||||||
|
|
||||||
print('Image name: {}'.format(image_name))
|
print('Image name: {}'.format(image_name))
|
||||||
|
|
||||||
darwinContainers = DarwinContainers(serverAddress=darwin_containers_host, verbose=False)
|
|
||||||
|
|
||||||
print('Opening container session...')
|
def handle_ssh_credentials(credentials):
|
||||||
with darwinContainers.workingImageSession(name=image_name) as session:
|
with DarwinContainers.ContainerSession(credentials=credentials) as session:
|
||||||
print('Uploading data to container...')
|
print('Uploading data to container...')
|
||||||
session_scp_upload(session=session, source_path=ipa_path, destination_path='')
|
session_scp_upload(session=session, source_path=ipa_path, destination_path='')
|
||||||
session_scp_upload(session=session, source_path=dsyms_path, destination_path='')
|
session_scp_upload(session=session, source_path=dsyms_path, destination_path='')
|
||||||
@ -182,11 +222,28 @@ def remote_deploy_testflight(darwin_containers_host, ipa_path, dsyms_path, usern
|
|||||||
|
|
||||||
print('Executing remote upload...')
|
print('Executing remote upload...')
|
||||||
session_ssh(session=session, command='bash -l guest-upload-telegram.sh')
|
session_ssh(session=session, command='bash -l guest-upload-telegram.sh')
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
def remote_ipa_diff(darwin_containers_host, ipa1_path, ipa2_path):
|
def handle_stopped():
|
||||||
macos_version = '12.5'
|
pass
|
||||||
|
|
||||||
from darwin_containers import DarwinContainers
|
DarwinContainers.DarwinContainers(
|
||||||
|
server_address=darwin_containers_host,
|
||||||
|
verbose=False
|
||||||
|
).run_image(
|
||||||
|
name=image_name,
|
||||||
|
is_base=False,
|
||||||
|
is_gui=True,
|
||||||
|
is_daemon=False,
|
||||||
|
on_ssh_credentials=handle_ssh_credentials,
|
||||||
|
on_stopped=handle_stopped
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def remote_ipa_diff(darwin_containers_path, darwin_containers_host, ipa1_path, ipa2_path):
|
||||||
|
macos_version = '13.0'
|
||||||
|
|
||||||
|
DarwinContainers = import_module_from_file('darwin-containers', darwin_containers_path)
|
||||||
|
|
||||||
configuration_path = 'versions.json'
|
configuration_path = 'versions.json'
|
||||||
xcode_version = ''
|
xcode_version = ''
|
||||||
@ -202,10 +259,10 @@ def remote_ipa_diff(darwin_containers_host, ipa1_path, ipa2_path):
|
|||||||
|
|
||||||
print('Image name: {}'.format(image_name))
|
print('Image name: {}'.format(image_name))
|
||||||
|
|
||||||
darwinContainers = DarwinContainers(serverAddress=darwin_containers_host, verbose=False)
|
|
||||||
|
|
||||||
print('Opening container session...')
|
print('Opening container session...')
|
||||||
with darwinContainers.workingImageSession(name=image_name) as session:
|
|
||||||
|
def handle_ssh_credentials(credentials):
|
||||||
|
with DarwinContainers.ContainerSession(credentials=credentials) as session:
|
||||||
print('Uploading data to container...')
|
print('Uploading data to container...')
|
||||||
session_scp_upload(session=session, source_path='tools/ipadiff.py', destination_path='ipadiff.py')
|
session_scp_upload(session=session, source_path='tools/ipadiff.py', destination_path='ipadiff.py')
|
||||||
session_scp_upload(session=session, source_path='tools/main.cpp', destination_path='main.cpp')
|
session_scp_upload(session=session, source_path='tools/main.cpp', destination_path='main.cpp')
|
||||||
@ -236,4 +293,19 @@ def remote_ipa_diff(darwin_containers_host, ipa1_path, ipa2_path):
|
|||||||
|
|
||||||
if guest_result != '0':
|
if guest_result != '0':
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
def handle_stopped():
|
||||||
|
pass
|
||||||
|
|
||||||
|
DarwinContainers.DarwinContainers(
|
||||||
|
server_address=darwin_containers_host,
|
||||||
|
verbose=False
|
||||||
|
).run_image(
|
||||||
|
name=image_name,
|
||||||
|
is_base=False,
|
||||||
|
is_gui=True,
|
||||||
|
is_daemon=False,
|
||||||
|
on_ssh_credentials=handle_ssh_credentials,
|
||||||
|
on_stopped=handle_stopped
|
||||||
|
)
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -9,6 +9,32 @@ swift_library(
|
|||||||
copts = [
|
copts = [
|
||||||
"-warnings-as-errors",
|
"-warnings-as-errors",
|
||||||
],
|
],
|
||||||
|
linkopts = [
|
||||||
|
"-Wl,-weak-lswiftCoreMIDI",
|
||||||
|
"-Wl,-weak-lswiftDataDetection",
|
||||||
|
"-Wl,-weak-lswiftFileProvider",
|
||||||
|
"-Wl,-weak-lswiftUniformTypeIdentifiers",
|
||||||
|
"-Wl,-weak-lswiftAVFoundation",
|
||||||
|
"-Wl,-lswiftCore",
|
||||||
|
"-Wl,-weak-lswiftCoreAudio",
|
||||||
|
"-Wl,-weak-lswiftCoreFoundation",
|
||||||
|
"-Wl,-weak-lswiftCoreImage",
|
||||||
|
"-Wl,-weak-lswiftCoreLocation",
|
||||||
|
"-Wl,-weak-lswiftCoreMedia",
|
||||||
|
"-Wl,-weak-lswiftDarwin",
|
||||||
|
"-Wl,-lswiftDispatch",
|
||||||
|
"-Wl,-weak-lswiftMetal",
|
||||||
|
"-Wl,-weak-lswiftNetwork",
|
||||||
|
"-Wl,-lswiftObjectiveC",
|
||||||
|
"-Wl,-weak-lswiftPhotos",
|
||||||
|
"-Wl,-weak-lswiftQuartzCore",
|
||||||
|
"-Wl,-weak-lswiftUIKit",
|
||||||
|
"-Wl,-weak-lswiftos",
|
||||||
|
"-Wl,-weak-lswiftsimd",
|
||||||
|
"-Wl,-lswiftFoundation",
|
||||||
|
"-Wl,-lswiftCloudKit",
|
||||||
|
"-Wl,-weak-lswiftCoreGraphics",
|
||||||
|
],
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/TelegramApi:TelegramApi",
|
"//submodules/TelegramApi:TelegramApi",
|
||||||
"//submodules/MtProtoKit:MtProtoKit",
|
"//submodules/MtProtoKit:MtProtoKit",
|
||||||
|
@ -48,6 +48,51 @@ swift_library(
|
|||||||
copts = [
|
copts = [
|
||||||
"-warnings-as-errors",
|
"-warnings-as-errors",
|
||||||
],
|
],
|
||||||
|
linkopts = [
|
||||||
|
"-Wl,-weak-lswiftCoreGraphics",
|
||||||
|
"-Wl,-weak-lswiftCompression",
|
||||||
|
"-Wl,-weak-lswiftCoreMIDI",
|
||||||
|
"-Wl,-weak-lswiftCoreML",
|
||||||
|
"-Wl,-weak-lswiftDataDetection",
|
||||||
|
"-Wl,-weak-lswiftFileProvider",
|
||||||
|
"-Wl,-weak-lswiftOSLog",
|
||||||
|
"-Wl,-weak-lswiftPassKit",
|
||||||
|
"-Wl,-weak-lswiftQuickLook",
|
||||||
|
"-Wl,-weak-lswiftSpeech",
|
||||||
|
"-Wl,-weak-lswiftUniformTypeIdentifiers",
|
||||||
|
"-Wl,-weak-lswiftWebKit",
|
||||||
|
"-Wl,-lswiftAVFoundation",
|
||||||
|
"-Wl,-weak-lswiftAccelerate",
|
||||||
|
"-Wl,-lswiftCallKit",
|
||||||
|
"-Wl,-lswiftCore",
|
||||||
|
"-Wl,-lswiftCoreAudio",
|
||||||
|
"-Wl,-lswiftCoreFoundation",
|
||||||
|
"-Wl,-weak-lswiftCoreImage",
|
||||||
|
"-Wl,-weak-lswiftCoreLocation",
|
||||||
|
"-Wl,-lswiftCoreMedia",
|
||||||
|
"-Wl,-lswiftDarwin",
|
||||||
|
"-Wl,-lswiftDispatch",
|
||||||
|
"-Wl,-weak-lswiftGLKit",
|
||||||
|
"-Wl,-weak-lswiftIntents",
|
||||||
|
"-Wl,-weak-lswiftMapKit",
|
||||||
|
"-Wl,-weak-lswiftMediaPlayer",
|
||||||
|
"-Wl,-weak-lswiftMetal",
|
||||||
|
"-Wl,-weak-lswiftMetalKit",
|
||||||
|
"-Wl,-weak-lswiftModelIO",
|
||||||
|
"-Wl,-weak-lswiftNaturalLanguage",
|
||||||
|
"-Wl,-weak-lswiftNetwork",
|
||||||
|
"-Wl,-lswiftObjectiveC",
|
||||||
|
"-Wl,-lswiftPhotos",
|
||||||
|
"-Wl,-weak-lswiftPhotosUI",
|
||||||
|
"-Wl,-lswiftQuartzCore",
|
||||||
|
"-Wl,-lswiftSceneKit",
|
||||||
|
"-Wl,-lswiftUIKit",
|
||||||
|
"-Wl,-weak-lswiftVision",
|
||||||
|
"-Wl,-weak-lswift_Concurrency",
|
||||||
|
"-Wl,-weak-lswiftos",
|
||||||
|
"-Wl,-weak-lswiftsimd",
|
||||||
|
"-Wl,-lswiftFoundation",
|
||||||
|
],
|
||||||
deps = [
|
deps = [
|
||||||
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
|
||||||
"//submodules/SSignalKit/SSignalKit:SSignalKit",
|
"//submodules/SSignalKit/SSignalKit:SSignalKit",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"app": "9.2.0",
|
"app": "9.2.0",
|
||||||
"bazel": "5.3.1",
|
"bazel": "5.3.1",
|
||||||
"xcode": "14.0"
|
"xcode": "14.1"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user