This commit is contained in:
Ali 2022-08-11 21:12:03 +04:00
parent c032aa320f
commit 7c07ceb8b1
3 changed files with 73 additions and 9 deletions

View File

@ -18,8 +18,8 @@ internal:
except: except:
- tags - tags
script: script:
- bash buildbox/build-telegram.sh hockeyapp - PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="http://host.docker.internal:8650" --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
- bash buildbox/deploy-telegram.sh hockeyapp - 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
artifacts: artifacts:
@ -37,8 +37,8 @@ appstore_development:
except: except:
- tags - tags
script: script:
- bash buildbox/build-telegram.sh appstore-development - PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="http://host.docker.internal:8650" --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
- bash buildbox/deploy-telegram.sh appstore-development - 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
artifacts: artifacts:
@ -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="http://host.docker.internal:8650" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath=build-system/appstore-configuration.json --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=appstore --configuration=release_arm64 - PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="http://host.docker.internal:8650" --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,8 +73,8 @@ experimental:
except: except:
- tags - tags
script: script:
- bash buildbox/build-telegram.sh appcenter-experimental-2 - PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="http://host.docker.internal:8650" --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
- bash buildbox/deploy-telegram.sh appcenter-experimental-2 - 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
artifacts: artifacts:
@ -92,7 +92,7 @@ beta_testflight:
except: except:
- tags - tags
script: script:
- bash buildbox/build-telegram.sh appstore - PYTHONPATH="$PYTHONPATH:/darwin-containers" python3 -u build-system/Make/Make.py remote-build --darwinContainersHost="http://host.docker.internal:8650" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="build-system/appstore-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=appstore --configuration=release_universal
environment: environment:
name: testflight_llc name: testflight_llc
artifacts: artifacts:

View File

@ -244,8 +244,10 @@ class GitCodesigningSource(CodesigningSource):
def copy_certificates_to_destination(self, destination_path): def copy_certificates_to_destination(self, destination_path):
source_path = None source_path = None
if self.codesigning_type in ['adhoc', 'appstore', 'enterprise']: if self.codesigning_type in ['adhoc', 'appstore']:
source_path = self.working_dir + '/decrypted/certs/distribution' source_path = self.working_dir + '/decrypted/certs/distribution'
elif self.codesigning_type == 'enterprise':
source_path = self.working_dir + '/decrypted/certs/enterprise'
elif self.codesigning_type == 'development': elif self.codesigning_type == 'development':
source_path = self.working_dir + '/decrypted/certs/development' source_path = self.working_dir + '/decrypted/certs/development'
else: else:

View File

@ -0,0 +1,62 @@
import os
import sys
import argparse
import json
from BuildEnvironment import check_run_system
def deploy_to_appstore_connect(args):
if not os.path.exists(args.configuration):
print('{} does not exist'.format(args.configuration))
sys.exit(1)
if not os.path.exists(args.ipa):
print('{} does not exist'.format(args.ipa))
sys.exit(1)
with open(args.configuration) as file:
configuration_dict = json.load(file)
required_keys = [
'username',
'app_name',
'api_token',
]
for key in required_keys:
if key not in configuration_dict:
print('Configuration at {} does not contain {}'.format(args.configuration, key))
check_run_system('appcenter login --token {token}'.format(token=configuration_dict['api_token']))
check_run_system('appcenter distribute release --app "{username}/{app_name}" -f "{ipa_path}" -g Internal'.format(
username=configuration_dict['username'],
app_name=configuration_dict['app_name'],
ipa_path=args.ipa,
))
if args.dsyms is not None:
check_run_system('appcenter crashes upload-symbols --app "{username}/{app_name}" --symbol "{dsym_path}"'.format(
username=configuration_dict['username'],
app_name=configuration_dict['app_name'],
dsym_path=args.dsyms
))
if __name__ == '__main__':
parser = argparse.ArgumentParser(prog='deploy-appstore-connect')
parser.add_argument(
'--configuration',
required=True,
help='Path to configuration json.'
)
parser.add_argument(
'--ipa',
required=True,
help='Path to IPA.'
)
if len(sys.argv) < 2:
parser.print_help()
sys.exit(1)
args = parser.parse_args()
deploy_to_appstore_connect(args)