Skip to content

Commit 283a82b

Browse files
committed
fix: support multiple teams in dev account
1 parent 6848b15 commit 283a82b

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

sign.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,11 @@ def clean_dev_portal_name(name: str):
279279
return re.sub("[^0-9a-zA-Z]+", " ", name).strip()
280280

281281

282-
def fastlane_auth(account_name: str, account_pass: str):
282+
def fastlane_auth(account_name: str, account_pass: str, team_id: str):
283283
my_env = os.environ.copy()
284284
my_env["FASTLANE_USER"] = account_name
285285
my_env["FASTLANE_PASSWORD"] = account_pass
286+
my_env["FASTLANE_TEAM_ID"] = team_id
286287

287288
auth_pipe = subprocess.Popen(
288289
# enable copy to clipboard so we're not interactively prompted
@@ -366,10 +367,13 @@ def fastlane_register_app_extras(
366367
)
367368

368369

369-
def fastlane_register_app(account_name: str, account_pass: str, bundle_id: str, entitlements: Dict[Any, Any]):
370+
def fastlane_register_app(
371+
account_name: str, account_pass: str, team_id: str, bundle_id: str, entitlements: Dict[Any, Any]
372+
):
370373
my_env = os.environ.copy()
371374
my_env["FASTLANE_USER"] = account_name
372375
my_env["FASTLANE_PASSWORD"] = account_pass
376+
my_env["FASTLANE_TEAM_ID"] = team_id
373377

374378
# no-op if already exists
375379
run_process(
@@ -465,11 +469,12 @@ def fastlane_register_app(account_name: str, account_pass: str, bundle_id: str,
465469

466470

467471
def fastlane_get_prov_profile(
468-
account_name: str, account_pass: str, bundle_id: str, prov_type: str, platform: str, out_file: Path
472+
account_name: str, account_pass: str, team_id: str, bundle_id: str, prov_type: str, platform: str, out_file: Path
469473
):
470474
my_env = os.environ.copy()
471475
my_env["FASTLANE_USER"] = account_name
472476
my_env["FASTLANE_PASSWORD"] = account_pass
477+
my_env["FASTLANE_TEAM_ID"] = team_id
473478

474479
with tempfile.TemporaryDirectory() as tmpdir_str:
475480
run_process(
@@ -833,13 +838,13 @@ def __sign_primary(self, component: Path, tmpdir: Path, data: ComponentData):
833838
shutil.copy2(self.opts.prov_file, embedded_prov)
834839
else:
835840
print("Registering component with Apple...")
836-
fastlane_register_app(self.opts.account_name, self.opts.account_pass, data.bundle_id, data.entitlements)
841+
fastlane_register_app(self.opts.account_name, self.opts.account_pass, self.opts.team_id, data.bundle_id, data.entitlements)
837842

838843
print("Generating provisioning profile...")
839844
prov_type = "adhoc" if self.is_distribution else "development"
840845
platform = "macos" if self.is_mac_app else "ios"
841846
fastlane_get_prov_profile(
842-
self.opts.account_name, self.opts.account_pass, data.bundle_id, prov_type, platform, embedded_prov
847+
self.opts.account_name, self.opts.account_pass, self.opts.team_id, data.bundle_id, prov_type, platform, embedded_prov
843848
)
844849

845850
entitlements_plist = Path(tmpdir).joinpath("entitlements.plist")
@@ -1069,7 +1074,7 @@ def sign(self):
10691074
"If you receive a two-factor authentication (2FA) code, please submit it to the web service.",
10701075
sep="\n",
10711076
)
1072-
fastlane_auth(self.opts.account_name, self.opts.account_pass)
1077+
fastlane_auth(self.opts.account_name, self.opts.account_pass, self.opts.team_id)
10731078

10741079
jobs: Dict[Path, subprocess.Popen[bytes]] = {}
10751080
for component, data in job_defs:

0 commit comments

Comments
 (0)