File tree Expand file tree Collapse file tree 3 files changed +40
-8
lines changed
Expand file tree Collapse file tree 3 files changed +40
-8
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,28 @@ jobs:
1515 uses : actions/setup-dotnet@v5
1616 with :
1717 dotnet-version : ' 10.x'
18- - if : matrix.os == 'macos-latest'
18+ - name : Query required Xcode version
19+ if : matrix.os == 'macos-latest'
20+ id : xcode-version
21+ run : |
22+ # Get the MacCatalyst SDK version from dotnet workload
23+ MACCATALYST_VERSION=$(dotnet workload list --verbosity detailed 2>&1 | grep -A 5 "maui-maccatalyst" | grep "Microsoft.MacCatalyst.Sdk" | sed -n 's/.*Microsoft.MacCatalyst.Sdk.net[0-9.]*_\([0-9.]*\).*/\1/p' | head -1)
24+
25+ if [ -z "$MACCATALYST_VERSION" ]; then
26+ echo "Could not determine MacCatalyst SDK version, using latest-stable Xcode"
27+ echo "xcode-version=latest-stable" >> $GITHUB_OUTPUT
28+ else
29+ # Extract major.minor version (e.g., 26.2 from 26.2.10191)
30+ XCODE_VERSION=$(echo $MACCATALYST_VERSION | cut -d. -f1-2)
31+ echo "Required Xcode version: $XCODE_VERSION"
32+ echo "xcode-version=$XCODE_VERSION" >> $GITHUB_OUTPUT
33+ fi
34+ shell : bash
35+ - name : Setup Xcode
36+ if : matrix.os == 'macos-latest'
1937 uses : maxim-lobanov/setup-xcode@v1
2038 with :
21- xcode-version : latest-stable
39+ xcode-version : ${{ steps.xcode-version.outputs.xcode-version }}
2240 - name : .NET Workload restore
2341 run : dotnet workload restore
2442 - name : Restore NuGet Packages
Original file line number Diff line number Diff line change 1414 uses : actions/setup-dotnet@v5
1515 with :
1616 dotnet-version : ' 10.x'
17- - if : matrix.os == 'macos-latest'
18- uses : maxim-lobanov/setup-xcode@v1
19- with :
20- xcode-version : latest-stable
2117 - name : Build GitHub Releases draft artifacts
2218 env :
2319 RELEASE_NOTES : |
Original file line number Diff line number Diff line change @@ -15,10 +15,28 @@ jobs:
1515 uses : actions/setup-dotnet@v5
1616 with :
1717 dotnet-version : ' 10.x'
18- - if : matrix.os == 'macos-latest'
18+ - name : Query required Xcode version
19+ if : matrix.os == 'macos-latest'
20+ id : xcode-version
21+ run : |
22+ # Get the MacCatalyst SDK version from dotnet workload
23+ MACCATALYST_VERSION=$(dotnet workload list --verbosity detailed 2>&1 | grep -A 5 "maui-maccatalyst" | grep "Microsoft.MacCatalyst.Sdk" | sed -n 's/.*Microsoft.MacCatalyst.Sdk.net[0-9.]*_\([0-9.]*\).*/\1/p' | head -1)
24+
25+ if [ -z "$MACCATALYST_VERSION" ]; then
26+ echo "Could not determine MacCatalyst SDK version, using latest-stable Xcode"
27+ echo "xcode-version=latest-stable" >> $GITHUB_OUTPUT
28+ else
29+ # Extract major.minor version (e.g., 26.2 from 26.2.10191)
30+ XCODE_VERSION=$(echo $MACCATALYST_VERSION | cut -d. -f1-2)
31+ echo "Required Xcode version: $XCODE_VERSION"
32+ echo "xcode-version=$XCODE_VERSION" >> $GITHUB_OUTPUT
33+ fi
34+ shell : bash
35+ - name : Setup Xcode
36+ if : matrix.os == 'macos-latest'
1937 uses : maxim-lobanov/setup-xcode@v1
2038 with :
21- xcode-version : latest-stable
39+ xcode-version : ${{ steps.xcode-version.outputs.xcode-version }}
2240 - name : Build and Test
2341 run : |
2442 dotnet workload restore
You can’t perform that action at this time.
0 commit comments