|
19 | 19 |
|
20 | 20 | secret_url = os.path.expandvars("$SECRET_URL").strip().rstrip("/") |
21 | 21 | secret_key = os.path.expandvars("$SECRET_KEY") |
22 | | -old_keychain: Optional[str] = None |
23 | 22 | StrPath = Union[str, Path] |
24 | 23 |
|
25 | 24 |
|
@@ -66,21 +65,6 @@ def rand_str(len: int, seed: Any = None): |
66 | 65 | return result |
67 | 66 |
|
68 | 67 |
|
69 | | -def kill_xcode(): |
70 | | - return run_process("killall", "Xcode", check=False) |
71 | | - |
72 | | - |
73 | | -def open_xcode(project: Optional[Path] = None): |
74 | | - if project: |
75 | | - return run_process("xed", str(project)) |
76 | | - else: |
77 | | - return run_process("xed") |
78 | | - |
79 | | - |
80 | | -def debug(): |
81 | | - return run_process("./debug.sh", capture=False) |
82 | | - |
83 | | - |
84 | 68 | def read_file(file_path: StrPath): |
85 | 69 | with open(file_path) as f: |
86 | 70 | return f.read() |
@@ -158,12 +142,6 @@ def curl_with_auth( |
158 | 142 | ) |
159 | 143 |
|
160 | 144 |
|
161 | | -def security_set_default_keychain(keychain: str): |
162 | | - old_keychain = decode_clean(run_process("security", "default-keychain").stdout).strip('"') |
163 | | - run_process("security", "default-keychain", "-s", keychain) |
164 | | - return old_keychain |
165 | | - |
166 | | - |
167 | 145 | def security_get_keychain_list(): |
168 | 146 | return map( |
169 | 147 | lambda x: x.strip('"'), |
@@ -1248,17 +1226,15 @@ def run(): |
1248 | 1226 | unsigned_ipa = Path("unsigned.ipa") |
1249 | 1227 | node_download(secret_url + f"/jobs/{job_id}/unsigned", unsigned_ipa, capture=False) |
1250 | 1228 |
|
| 1229 | + failed = False |
1251 | 1230 | try: |
1252 | | - failed = False |
1253 | 1231 | run() |
1254 | 1232 | except: |
1255 | 1233 | failed = True |
1256 | 1234 | traceback.print_exc() |
1257 | 1235 | finally: |
1258 | 1236 | print("Cleaning up...") |
1259 | | - if old_keychain: |
1260 | | - security_set_default_keychain(old_keychain) |
1261 | | - security_remove_keychain(keychain_name) |
| 1237 | + security_remove_keychain(keychain_name) |
1262 | 1238 | if failed: |
1263 | 1239 | curl_with_auth(f"{secret_url}/jobs/{job_id}/fail") |
1264 | 1240 | sys.exit(1) |
0 commit comments