Skip to content

Commit

Permalink
Use Xcode 16. (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbritch authored Oct 2, 2024
1 parent 5d8a5b2 commit a1d388d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
# if: runner.os == 'macOS' # reenable when .NET 8 is default on hosted runners

- name: Select Xcode Version
run: sudo xcode-select -s /Applications/Xcode_15.4.app
run: sudo xcode-select -s /Applications/Xcode_16.0.app
if: runner.os == 'macOS' # Remove when Xcode 15+ is default on the hosted runners

- name: Find and build all C# projects
run: |
$failedProjectCount=0
Expand All @@ -38,55 +38,55 @@ jobs:
$excluded_projects=@()
$jobSummaryFile=$env:GITHUB_STEP_SUMMARY
if (Test-Path $excluded_projects_file) {
$excluded_projects = Get-Content -Path $excluded_projects_file | Where-Object { $_ -notmatch "^\s*#" -and $_ -match "\S" }
}
Write-Output "# .NET MAUI Sample Apps Build Status (${{ runner.os }})" | Out-File -FilePath $jobSummaryFile -Append
Write-Output "| Project | Build Status |" | Out-File -FilePath $jobSummaryFile -Append
Write-Output "|---|---|" | Out-File -FilePath $jobSummaryFile -Append
Get-ChildItem -Path . -Filter *.csproj -File -Recurse | ForEach-Object {
$csproj = $_.FullName
$relativePath = (Resolve-Path -Path $csproj -Relative).Replace("\", "/")
# Check if the project is in the exclusion list
if ($excluded_projects -contains $relativePath) {
Write-Output "::notice:: Skipping build for excluded project: $relativePath"
Write-Output "| $csproj | Skipped |" | Out-File -FilePath $jobSummaryFile -Append
$skippedProjectCount++
}
else {
Write-Output "::group:: Building $csproj"
dotnet build $csproj
if ($LASTEXITCODE -gt 0) {
Write-Output "::error:: Build failed for $csproj"
Write-Output "| $relativePath | :x: |" | Out-File -FilePath $jobSummaryFile -Append
$failedProjectCount++
}
else {
Write-Output "Build succeeded for $csproj"
Write-Output "| $relativePath | :white_check_mark: |" | Out-File -FilePath $jobSummaryFile -Append
}
$proj_dir = [System.IO.Path]::GetDirectoryName($csproj)
Write-Output "Cleaning up bin & obj in $proj_dir"
Get-ChildItem -Path $proj_dir -Directory -Recurse -Include bin,obj | Remove-Item -Recurse -Force
Write-Output "::endgroup::"
}
}
if ($failedProjectCount -gt 0) {
Write-Output "" | Out-File -FilePath $jobSummaryFile -Append
Write-Output "# Failed builds: $failedProjectCount" | Out-File -FilePath $jobSummaryFile -Append
Write-Output "# Skipped builds: $skippedProjectCount" | Out-File -FilePath $jobSummaryFile -Append
exit $failedProjectCount
}
shell: powershell
6 changes: 3 additions & 3 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
# if: runner.os == 'macOS' # reenable when .NET 8 is default on hosted runners

- name: Select Xcode Version
run: sudo xcode-select -s /Applications/Xcode_15.4.app
run: sudo xcode-select -s /Applications/Xcode_16.0.app
if: runner.os == 'macOS'

- name: Find and build changed projects
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
$projectToBuild = $file
} else {
$currentFolder = (Get-Item -LiteralPath (Resolve-Path -Path "$file")).Directory
while ($currentFolder -ne $null -and '' -ne $currentFolder) {
$csprojFiles = Get-ChildItem -Path $currentFolder -Filter '*.csproj' -File
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
Write-Output "" | Out-File -FilePath $jobSummaryFile -Append
Write-Output "# Failed builds: $failedProjectCount" | Out-File -FilePath $jobSummaryFile -Append
Write-Output "# Skipped builds: $skippedProjectCount" | Out-File -FilePath $jobSummaryFile -Append
exit $failedProjectCount
}
shell: powershell

0 comments on commit a1d388d

Please sign in to comment.