Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 55 additions & 5 deletions .github/workflows/build-samples-todoapp-avalonia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_CONFIGURATION: 'Release'
# NOTE: This sample's solution (TodoApp.Avalonia.sln) also contains Android and iOS
# heads (net10.0-android / net10.0-ios), which require mobile workloads and are tracked
# separately in https://github.com/CommunityToolkit/Datasync/issues/511 (Phase 3). Only
# the shared and Desktop (net10.0) projects are built directly here, not the full .sln.
# NOTE: This sample's solution (TodoApp.Avalonia.sln) also contains Android and iOS heads
# (net10.0-android / net10.0-ios). Only the shared and Desktop (net10.0) projects are built
# directly here, not the full .sln - the Android and iOS heads are built by their own jobs
# below, each restoring/building its own project directly so only the workload needed for
# that head is installed on that runner.
SharedProjectFile: 'samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/TodoApp.Avalonia.csproj'
DesktopProjectFile: 'samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia.Desktop/TodoApp.Avalonia.Desktop.csproj'
AndroidProjectFile: 'samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia.Android/TodoApp.Avalonia.Android.csproj'
iOSProjectFile: 'samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia.iOS/TodoApp.Avalonia.iOS.csproj'

permissions:
contents: read

jobs:
build:
desktop:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
Expand Down Expand Up @@ -47,3 +50,50 @@ jobs:
dotnet build ${{ env.DesktopProjectFile }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore

android:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install Android workload
run: dotnet workload install android

- name: Restore Android project
run: dotnet restore ${{ env.AndroidProjectFile }}

- name: Build Android project
run: >
dotnet build ${{ env.AndroidProjectFile }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore

ios:
# iOS builds require Xcode, which is only available on macOS runners.
runs-on: macos-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install iOS workload
run: dotnet workload install ios

- name: Restore iOS project
run: dotnet restore ${{ env.iOSProjectFile }}

- name: Build iOS project
run: >
dotnet build ${{ env.iOSProjectFile }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore
72 changes: 72 additions & 0 deletions .github/workflows/build-samples-todoapp-maui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build Sample - TodoApp MAUI (Android / iOS)

on:
workflow_call:

env:
DOTNET_VERSION: '10.0.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_CONFIGURATION: 'Release'
# TodoApp.MAUI.csproj targets net10.0-android;net10.0-ios, with net10.0-windows10.0.19041.0
# conditionally appended only when building on Windows (that head is built separately in
# build-samples-todoapp-windows.yml). Restore/build here is explicitly scoped to one mobile
# TargetFramework per job so each runner only needs the workload for its own head.
MauiProjectFile: 'samples/todoapp/TodoApp.MAUI/TodoApp.MAUI.csproj'
AndroidTargetFramework: 'net10.0-android'
iOSTargetFramework: 'net10.0-ios'

permissions:
contents: read

jobs:
android:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install MAUI Android workload
run: dotnet workload install maui-android

- name: Restore MAUI project (Android TFM only)
# NOTE: 'dotnet restore' has no -f|--framework option (-f means --force there, unlike
# 'dotnet build'). Use the MSBuild property directly to scope restore to one TFM.
run: dotnet restore ${{ env.MauiProjectFile }} -p:TargetFramework=${{ env.AndroidTargetFramework }}

- name: Build MAUI project (Android TFM only)
run: >
dotnet build ${{ env.MauiProjectFile }}
-f ${{ env.AndroidTargetFramework }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore

ios:
# iOS builds require Xcode, which is only available on macOS runners.
runs-on: macos-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install MAUI iOS workload
run: dotnet workload install maui-ios

- name: Restore MAUI project (iOS TFM only)
run: dotnet restore ${{ env.MauiProjectFile }} -p:TargetFramework=${{ env.iOSTargetFramework }}

- name: Build MAUI project (iOS TFM only)
run: >
dotnet build ${{ env.MauiProjectFile }}
-f ${{ env.iOSTargetFramework }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore
165 changes: 165 additions & 0 deletions .github/workflows/build-samples-todoapp-uno.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
name: Build Sample - TodoApp Uno

# NOTE: This workflow is NOT currently wired into build-samples.yml. TodoApp.Uno.csproj fails
# to restore on every head with NU1605 (Uno.WinUI version downgrade caused by
# CommunityToolkit.WinUI.Behaviors' floor vs. the Uno.Sdk pin in global.json) - see the jobs
# below and https://github.com/CommunityToolkit/Datasync/issues/506, which is tracking the fix.
# Re-add the `todoapp-uno` job to build-samples.yml (and to all-samples-built's `needs`) once
# #506 is resolved and TodoApp.Uno.csproj restores cleanly.

on:
workflow_call:

env:
DOTNET_VERSION: '10.0.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_CONFIGURATION: 'Release'
# TodoApp.Uno.csproj is a single Uno.Sdk project with a multi-head TargetFrameworks list
# (net10.0-android;net10.0-ios;net10.0-maccatalyst;net10.0-windows10.0.26100;
# net10.0-browserwasm;net10.0-desktop). No single runner can build every head (mobile heads
# need Android/iOS workloads, the Windows head needs windows-latest, etc.), so each job below
# restores/builds one head at a time, scoped via the MSBuild TargetFramework property.
UnoProjectFile: 'samples/todoapp/TodoApp.Uno/TodoApp.Uno/TodoApp.Uno.csproj'
AndroidTargetFramework: 'net10.0-android'
iOSTargetFramework: 'net10.0-ios'
MacCatalystTargetFramework: 'net10.0-maccatalyst'
WindowsTargetFramework: 'net10.0-windows10.0.26100'
BrowserWasmTargetFramework: 'net10.0-browserwasm'
DesktopTargetFramework: 'net10.0-desktop'

permissions:
contents: read

jobs:
android:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install Android workload
run: dotnet workload install android

- name: Restore Uno project (Android TFM only)
# NOTE: 'dotnet restore' has no -f|--framework option (-f means --force there, unlike
# 'dotnet build'). Use the MSBuild property directly to scope restore to one TFM.
run: dotnet restore ${{ env.UnoProjectFile }} -p:TargetFramework=${{ env.AndroidTargetFramework }}

- name: Build Uno project (Android TFM only)
run: >
dotnet build ${{ env.UnoProjectFile }}
-f ${{ env.AndroidTargetFramework }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore

ios-maccatalyst:
# iOS and Mac Catalyst builds both require Xcode, which is only available on macOS runners.
runs-on: macos-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install iOS and Mac Catalyst workloads
run: dotnet workload install ios maccatalyst

- name: Restore Uno project (iOS TFM only)
run: dotnet restore ${{ env.UnoProjectFile }} -p:TargetFramework=${{ env.iOSTargetFramework }}

- name: Build Uno project (iOS TFM only)
run: >
dotnet build ${{ env.UnoProjectFile }}
-f ${{ env.iOSTargetFramework }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore

- name: Restore Uno project (Mac Catalyst TFM only)
run: dotnet restore ${{ env.UnoProjectFile }} -p:TargetFramework=${{ env.MacCatalystTargetFramework }}

- name: Build Uno project (Mac Catalyst TFM only)
run: >
dotnet build ${{ env.UnoProjectFile }}
-f ${{ env.MacCatalystTargetFramework }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore

windows:
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore Uno project (Windows TFM only)
run: dotnet restore ${{ env.UnoProjectFile }} -p:TargetFramework=${{ env.WindowsTargetFramework }}

- name: Build Uno project (Windows TFM only)
run: >
dotnet build ${{ env.UnoProjectFile }}
-f ${{ env.WindowsTargetFramework }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore

browserwasm:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install WebAssembly build tools workload
run: dotnet workload install wasm-tools

- name: Restore Uno project (Browser WebAssembly TFM only)
run: dotnet restore ${{ env.UnoProjectFile }} -p:TargetFramework=${{ env.BrowserWasmTargetFramework }}

- name: Build Uno project (Browser WebAssembly TFM only)
run: >
dotnet build ${{ env.UnoProjectFile }}
-f ${{ env.BrowserWasmTargetFramework }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore

desktop:
# NOTE: this head (along with every other head in this file) currently fails to restore
# with NU1605 - see the file-level NOTE above and #506. #506 originally reported the NU1903
# Tmds.DBus audit warning for this head specifically; that warning alone is harmless (this
# repo does not configure NuGet audit to fail on warnings), but the NU1605 uncovered while
# investigating it turned out to be project-wide, not desktop-specific.
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v7

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore Uno project (Desktop TFM only)
run: dotnet restore ${{ env.UnoProjectFile }} -p:TargetFramework=${{ env.DesktopTargetFramework }}

- name: Build Uno project (Desktop TFM only)
run: >
dotnet build ${{ env.UnoProjectFile }}
-f ${{ env.DesktopTargetFramework }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore
4 changes: 2 additions & 2 deletions .github/workflows/build-samples-todoapp-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ env:
WpfProjectFile: 'samples/todoapp/TodoApp.WPF/TodoApp.WPF.csproj'
# TodoApp.MAUI.csproj targets net10.0-android;net10.0-ios, with net10.0-windows10.0.19041.0
# conditionally appended only when building on Windows. Android/iOS heads require separate
# workloads and are tracked in https://github.com/CommunityToolkit/Datasync/issues/511 (Phase 3),
# so restore/build here is explicitly scoped to the Windows TargetFramework only.
# workloads and are built by build-samples-todoapp-maui.yml instead, so restore/build here is
# explicitly scoped to the Windows TargetFramework only.
MauiProjectFile: 'samples/todoapp/TodoApp.MAUI/TodoApp.MAUI.csproj'
MauiWindowsTargetFramework: 'net10.0-windows10.0.19041.0'

Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/build-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,23 @@ jobs:
todoapp-windows:
uses: ./.github/workflows/build-samples-todoapp-windows.yml

todoapp-maui:
uses: ./.github/workflows/build-samples-todoapp-maui.yml

# NOTE: todoapp-uno (build-samples-todoapp-uno.yml) is intentionally NOT wired in here.
# TodoApp.Uno.csproj fails to restore on every head with:
# NU1605: Detected package downgrade: Uno.WinUI from 5.5.87 to 5.4.22
# TodoApp.Uno -> CommunityToolkit.WinUI.Behaviors 8.2.250402 -> Uno.WinUI (>= 5.5.87)
# TodoApp.Uno -> Uno.WinUI (>= 5.4.22)
# This is unconditional (CommunityToolkit.WinUI.Behaviors has no TFM condition on its
# PackageReference), so it blocks every TFM, not just the desktop head as originally
# suspected. See https://github.com/CommunityToolkit/Datasync/issues/506, which is tracking
# the underlying Uno.WinUI/CommunityToolkit.WinUI.Behaviors version conflict. Re-enable this
# job (add it back to the jobs list and to all-samples-built's needs below) once #506 is
# resolved and TodoApp.Uno.csproj restores cleanly.

# Single aggregation point so branch protection only needs to require one check,
# regardless of how many sample workflows are added over time (see Phase 3
# follow-up: https://github.com/CommunityToolkit/Datasync/issues/511).
# regardless of how many sample workflows are added over time.
all-samples-built:
name: All samples built
if: always()
Expand All @@ -48,6 +62,7 @@ jobs:
- todoapp-tutorial
- todoapp-avalonia
- todoapp-windows
- todoapp-maui
runs-on: ubuntu-latest
steps:
- name: Check sample build results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MinimumOSVersion</key>
<string>13.0</string>
<string>15.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
Expand Down
Loading