Skip to content

Commit a683803

Browse files
committed
Update build.yml
1 parent d0477db commit a683803

1 file changed

Lines changed: 46 additions & 46 deletions

File tree

.github/workflows/build.yml

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -28,53 +28,53 @@ jobs:
2828
run: |
2929
set -euo pipefail
3030
31-
# macOS 메인 버전에 맞는 iOS 버전 중 최신 버전의 iPhone 선택
32-
RESULT=$(python3 - <<'PY'
33-
import re, subprocess, sys
34-
35-
mac_ver = subprocess.check_output(["sw_vers", "-productVersion"], text=True).strip()
36-
mac_major = mac_ver.split('.')[0]
37-
38-
text = subprocess.check_output(["xcrun", "simctl", "list", "devices"], text=True)
39-
lines = text.splitlines()
40-
41-
def ver_key(v):
42-
return tuple(int(x) for x in v.split('.'))
43-
44-
# 1) 최신 iOS 버전(해당 mac 메이저) 찾기
45-
latest_ver = None
46-
for line in lines:
47-
header = re.match(r"^-- iOS ([0-9]+(?:\.[0-9]+)*) --$", line.strip())
48-
if not header:
49-
continue
50-
ver = header.group(1)
51-
if not ver.startswith(f"{mac_major}."):
52-
continue
53-
if latest_ver is None or ver_key(ver) > ver_key(latest_ver):
54-
latest_ver = ver
55-
56-
if latest_ver is None:
57-
print(f"No iOS versions found for macOS major {mac_major}", file=sys.stderr)
58-
sys.exit(1)
59-
60-
# 2) 해당 버전 섹션에서 첫 iPhone 찾고 즉시 종료
61-
current_ver = None
62-
for line in lines:
63-
header = re.match(r"^-- iOS ([0-9]+(?:\.[0-9]+)*) --$", line.strip())
64-
if header:
65-
current_ver = header.group(1)
66-
continue
67-
if current_ver != latest_ver:
68-
continue
69-
if "(unavailable)" in line:
70-
continue
71-
if "iPhone" in line:
72-
name = line.strip()
73-
print(f"{latest_ver}|{name}")
74-
sys.exit(0)
75-
76-
print(f"No iPhone candidates found for iOS {latest_ver}", file=sys.stderr)
31+
# macOS 메인 버전에 맞는 iOS 버전 중 최신 버전의 iPhone 선택
32+
RESULT=$(python3 - <<'PY'
33+
import re, subprocess, sys
34+
35+
mac_ver = subprocess.check_output(["sw_vers", "-productVersion"], text=True).strip()
36+
mac_major = mac_ver.split('.')[0]
37+
38+
text = subprocess.check_output(["xcrun", "simctl", "list", "devices"], text=True)
39+
lines = text.splitlines()
40+
41+
def ver_key(v):
42+
return tuple(int(x) for x in v.split('.'))
43+
44+
# 1) 최신 iOS 버전(해당 mac 메이저) 찾기
45+
latest_ver = None
46+
for line in lines:
47+
header = re.match(r"^-- iOS ([0-9]+(?:\.[0-9]+)*) --$", line.strip())
48+
if not header:
49+
continue
50+
ver = header.group(1)
51+
if not ver.startswith(f"{mac_major}."):
52+
continue
53+
if latest_ver is None or ver_key(ver) > ver_key(latest_ver):
54+
latest_ver = ver
55+
56+
if latest_ver is None:
57+
print(f"No iOS versions found for macOS major {mac_major}", file=sys.stderr)
7758
sys.exit(1)
59+
60+
# 2) 해당 버전 섹션에서 첫 iPhone 찾고 즉시 종료
61+
current_ver = None
62+
for line in lines:
63+
header = re.match(r"^-- iOS ([0-9]+(?:\.[0-9]+)*) --$", line.strip())
64+
if header:
65+
current_ver = header.group(1)
66+
continue
67+
if current_ver != latest_ver:
68+
continue
69+
if "(unavailable)" in line:
70+
continue
71+
if "iPhone" in line:
72+
name = line.strip()
73+
print(f"{latest_ver}|{name}")
74+
sys.exit(0)
75+
76+
print(f"No iPhone candidates found for iOS {latest_ver}", file=sys.stderr)
77+
sys.exit(1)
7878
PY
7979
)
8080

0 commit comments

Comments
 (0)