File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,10 +57,27 @@ jobs:
5757 git_url : ${{ env.MATCH_GIT_URL }}
5858 git_basic_authorization : ${{ env.MATCH_GIT_BASIC_AUTHORIZATION }}
5959
60- - name : Set up Xcode
61- uses : maxim-lobanov/setup-xcode@v1
62- with :
63- xcode-version : ${{ env.XCODE_VERSION }}
60+ - name : Select Xcode
61+ shell : bash
62+ run : |
63+ set -euo pipefail
64+
65+ if [ "$XCODE_VERSION" = "latest" ]; then
66+ XCODE_APP="$(find /Applications -maxdepth 1 -name 'Xcode*.app' -type d | sort -V | tail -n 1)"
67+ else
68+ XCODE_APP="/Applications/Xcode_${XCODE_VERSION}.app"
69+ if [ ! -d "$XCODE_APP" ]; then
70+ XCODE_APP="/Applications/Xcode-${XCODE_VERSION}.app"
71+ fi
72+ fi
73+
74+ if [ ! -d "${XCODE_APP:-}" ]; then
75+ echo "Requested Xcode not found for version: $XCODE_VERSION" >&2
76+ exit 1
77+ fi
78+
79+ sudo xcode-select -s "$XCODE_APP/Contents/Developer"
80+ xcodebuild -version
6481
6582 - name : Cache SwiftPM
6683 uses : actions/cache@v5
Original file line number Diff line number Diff line change @@ -46,10 +46,27 @@ jobs:
4646 bundler-cache : true
4747 ruby-version : ${{ env.RUBY_VERSION }}
4848
49- - name : Set up Xcode
50- uses : maxim-lobanov/setup-xcode@v1
51- with :
52- xcode-version : ${{ env.XCODE_VERSION }}
49+ - name : Select Xcode
50+ shell : bash
51+ run : |
52+ set -euo pipefail
53+
54+ if [ "$XCODE_VERSION" = "latest" ]; then
55+ XCODE_APP="$(find /Applications -maxdepth 1 -name 'Xcode*.app' -type d | sort -V | tail -n 1)"
56+ else
57+ XCODE_APP="/Applications/Xcode_${XCODE_VERSION}.app"
58+ if [ ! -d "$XCODE_APP" ]; then
59+ XCODE_APP="/Applications/Xcode-${XCODE_VERSION}.app"
60+ fi
61+ fi
62+
63+ if [ ! -d "${XCODE_APP:-}" ]; then
64+ echo "Requested Xcode not found for version: $XCODE_VERSION" >&2
65+ exit 1
66+ fi
67+
68+ sudo xcode-select -s "$XCODE_APP/Contents/Developer"
69+ xcodebuild -version
5370
5471 - name : Write App Store Connect API key
5572 env :
Original file line number Diff line number Diff line change @@ -43,10 +43,27 @@ jobs:
4343 bundler-cache : true
4444 ruby-version : ${{ env.RUBY_VERSION }}
4545
46- - name : Set up Xcode
47- uses : maxim-lobanov/setup-xcode@v1
48- with :
49- xcode-version : ${{ env.XCODE_VERSION }}
46+ - name : Select Xcode
47+ shell : bash
48+ run : |
49+ set -euo pipefail
50+
51+ if [ "$XCODE_VERSION" = "latest" ]; then
52+ XCODE_APP="$(find /Applications -maxdepth 1 -name 'Xcode*.app' -type d | sort -V | tail -n 1)"
53+ else
54+ XCODE_APP="/Applications/Xcode_${XCODE_VERSION}.app"
55+ if [ ! -d "$XCODE_APP" ]; then
56+ XCODE_APP="/Applications/Xcode-${XCODE_VERSION}.app"
57+ fi
58+ fi
59+
60+ if [ ! -d "${XCODE_APP:-}" ]; then
61+ echo "Requested Xcode not found for version: $XCODE_VERSION" >&2
62+ exit 1
63+ fi
64+
65+ sudo xcode-select -s "$XCODE_APP/Contents/Developer"
66+ xcodebuild -version
5067
5168 - name : Write App Store Connect API key
5269 env :
You can’t perform that action at this time.
0 commit comments