diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f0f35a..c38c2d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,7 +84,11 @@ jobs: build-macos: name: Build macOS Package And Sample - runs-on: macos-latest + # macos-26 image ships with Xcode 26.x, required by the .NET 10 macOS workload + # (Xamarin.Shared.Sdk targets refuse to build/link with older Xcode). The + # macos-latest label is still pinned to macOS 15 (Xcode 16.x), which causes + # "This version of .NET for macOS requires Xcode 26.0" build errors. + runs-on: macos-26 steps: - name: Checkout @@ -95,6 +99,22 @@ jobs: with: dotnet-version: ${{ env.DOTNET_VERSION }} + - name: Select Xcode 26.0 + # The .NET 10 macOS workload (Microsoft.macOS.Sdk.net10.0_26.0 26.0.11017) + # pins Xcode to 26.0 exactly. The macos-26 image defaults to a newer Xcode + # (e.g. 26.2), which causes "requires Xcode 26.0" build errors. Switch to + # the Xcode 26.0.x installed on the image. Use the canonical 26.0.1 path + # rather than the /Applications/Xcode_26.0.app symlink — xcrun/xcodebuild + # otherwise fail to resolve the MacOSX SDK ("SDK ... cannot be located", + # "install_name_tool exited with code 72"). Also run -runFirstLaunch so + # the SDK / command-line components are registered for the new selection. + shell: bash + run: | + sudo xcode-select -s /Applications/Xcode_26.0.1.app + sudo xcodebuild -runFirstLaunch + xcodebuild -version + xcrun --sdk macosx --show-sdk-path + - name: Install macOS workload shell: bash run: dotnet workload install macos --skip-manifest-update diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 50c9be0..ed65cc0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -135,7 +135,8 @@ jobs: pack-nuget-macos: name: Pack And Publish macOS NuGet - runs-on: macos-latest + # macos-26 ships with Xcode 26.x as required by the .NET 10 macOS workload. + runs-on: macos-26 needs: pack-nuget steps: @@ -147,6 +148,19 @@ jobs: with: dotnet-version: ${{ env.DOTNET_VERSION }} + - name: Select Xcode 26.0 + # The .NET 10 macOS workload pins Xcode to 26.0 exactly; the macos-26 + # image defaults to a newer Xcode that the Xamarin SDK rejects. Use the + # canonical Xcode_26.0.1.app path (not the /Applications/Xcode_26.0.app + # symlink), and run -runFirstLaunch so the MacOSX SDK / command-line + # components are properly registered for the new selection. + shell: bash + run: | + sudo xcode-select -s /Applications/Xcode_26.0.1.app + sudo xcodebuild -runFirstLaunch + xcodebuild -version + xcrun --sdk macosx --show-sdk-path + - name: Install macOS workload shell: bash run: dotnet workload install macos --skip-manifest-update @@ -349,7 +363,8 @@ jobs: publish-samples-macos: name: Publish macOS Samples - runs-on: macos-latest + # macos-26 ships with Xcode 26.x as required by the .NET 10 macOS workload. + runs-on: macos-26 needs: pack-nuget steps: @@ -361,6 +376,19 @@ jobs: with: dotnet-version: ${{ env.DOTNET_VERSION }} + - name: Select Xcode 26.0 + # The .NET 10 macOS workload pins Xcode to 26.0 exactly; the macos-26 + # image defaults to a newer Xcode that the Xamarin SDK rejects. Use the + # canonical Xcode_26.0.1.app path (not the /Applications/Xcode_26.0.app + # symlink), and run -runFirstLaunch so the MacOSX SDK / command-line + # components are properly registered for the new selection. + shell: bash + run: | + sudo xcode-select -s /Applications/Xcode_26.0.1.app + sudo xcodebuild -runFirstLaunch + xcodebuild -version + xcrun --sdk macosx --show-sdk-path + - name: Install macOS workload shell: bash run: dotnet workload install macos --skip-manifest-update diff --git a/samples/NativeWebHost.Sample.Mac/NativeWebHost.Sample.Mac.csproj b/samples/NativeWebHost.Sample.Mac/NativeWebHost.Sample.Mac.csproj index 9488164..c2df212 100644 --- a/samples/NativeWebHost.Sample.Mac/NativeWebHost.Sample.Mac.csproj +++ b/samples/NativeWebHost.Sample.Mac/NativeWebHost.Sample.Mac.csproj @@ -8,6 +8,8 @@ NativeWebHost.Sample.Mac NativeWebHost.Sample.Mac 0.1.0-preview.3 + com.iotsharp.nativewebhost.sample.mac + NativeWebHost.Sample.Mac $(NativeWebHostMacOSMinimumVersion)