File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,11 @@ name: iOS CI
33on :
44 pull_request :
55
6+ permissions :
7+ contents : read
8+ issues : write
9+ pull-requests : write
10+
611jobs :
712 build :
813 runs-on : macos-14 # iOS 17 시뮬레이터 런타임 포함
@@ -31,17 +36,20 @@ jobs:
3136 )
3237
3338 if [ "${#versions[@]}" -eq 0 ]; then
34- echo "No iOS simulator runtimes detected. Falling back to MIN_IOS=${MIN_IOS}"
39+ echo "No iOS simulator runtimes detected." >&2
40+ exit 1
41+ fi
42+
43+ # MIN_IOS 이상 중 가장 낮은 버전 선택 (우선 MIN_IOS)
44+ if printf '%s\n' "${versions[@]}" | grep -qx "$MIN_IOS"; then
3545 chosen="$MIN_IOS"
3646 else
37- last_index=$(( ${#versions[@]} - 1 ))
38- highest="${versions[$last_index]}"
39- # chosen = max(MIN_IOS, highest)
40- if [ "$(printf "%s\n%s\n" "$MIN_IOS" "$highest" | sort -V | tail -n 1)" = "$highest" ]; then
41- chosen="$highest"
42- else
43- chosen="$MIN_IOS"
44- fi
47+ chosen=$(printf '%s\n' "${versions[@]}" | awk -v min="$MIN_IOS" '$0+0 >= min+0 {print}' | sort -V | head -n 1 || true)
48+ fi
49+
50+ if [ -z "${chosen:-}" ]; then
51+ echo "No iOS runtime >= ${MIN_IOS} found. Available: ${versions[*]}" >&2
52+ exit 1
4553 fi
4654
4755 echo "Detected runtimes: ${versions[*]:-<none>}"
You can’t perform that action at this time.
0 commit comments