Skip to content

ci: add build-samples workflow for Phase 2 Windows-only heads (#510)#514

Merged
adrianhall merged 3 commits into
CommunityToolkit:mainfrom
adrianhall:issues/510
Jul 7, 2026
Merged

ci: add build-samples workflow for Phase 2 Windows-only heads (#510)#514
adrianhall merged 3 commits into
CommunityToolkit:mainfrom
adrianhall:issues/510

Conversation

@adrianhall

Copy link
Copy Markdown
Collaborator

Summary

Closes #510 (Phase 2 of the samples CI rollout, follow-up to #509 / PR #512).

Adds windows-latest CI coverage for the Windows-only TodoApp build heads that Phase 1 explicitly deferred:

Sample Project TFM
WinUI3 samples/todoapp/TodoApp.WinUI3/TodoApp.WinUI3.csproj net10.0-windows10.0.19041.0
WPF samples/todoapp/TodoApp.WPF/TodoApp.WPF.csproj net10.0-windows
MAUI (Windows head only) samples/todoapp/TodoApp.MAUI/TodoApp.MAUI.csproj net10.0-windows10.0.19041.0
TodoApp tutorial client samples/todoapp-tutorial/ClientApp/ClientApp.csproj net10.0-windows (WPF)

Changes

  • New build-samples-todoapp-windows.yml — a windows-latest job that builds WinUI3, WPF, and MAUI in sequence:
    • WinUI3 is built with -p:Platform=x64, since the project declares <Platforms>x86;x64;ARM64</Platforms> with no AnyCPU — the CLI's default Platform=AnyCPU is not valid for this project.
    • MAUI is restored/built scoped to -f net10.0-windows10.0.19041.0 only, after installing the maui-windows workload. TodoApp.MAUI.csproj targets net10.0-android;net10.0-ios, with the Windows TFM conditionally appended only when building on Windows — the Android/iOS heads need separate workloads and remain out of scope here (tracked in Add CI workflow to build mobile /samples heads: Android, iOS, Uno (Phase 3 of #509) #511, Phase 3). Using maui-windows (rather than the generic maui meta-workload) avoids pulling in the Android SDK on this runner.
  • Modified build-samples-todoapp-tutorial.yml — added a second job, build-clientapp (windows-latest), building ClientApp.csproj (WPF). The existing ServerApp job (renamed build-serverapp) is unchanged aside from the env var rename (ProjectFileServerProjectFile) for symmetry with the new ClientProjectFile. Removed the now-resolved comment deferring ClientApp to this issue.
  • Modified build-samples.yml — wired the new todoapp-windows job into the orchestrator and the all-samples-built gate job; updated the stale Phase 2/3 comment to reference only the remaining Phase 3 follow-up (Add CI workflow to build mobile /samples heads: Android, iOS, Uno (Phase 3 of #509) #511).

Verification

  • actionlint passes on all 3 changed/new workflow files.
  • dotnet restore Datasync.Toolkit.sln && dotnet build Datasync.Toolkit.sln --configuration Release --no-restore succeeds with 0 errors/warnings (confirms no regression to the core library; the root solution doesn't reference samples/**).
  • Not verified locally: the actual dotnet restore/build execution for the four Windows-only heads above. This dev environment is macOS with no .NET workloads installed and no support for net10.0-windows* TFMs, so these steps can only be exercised once this PR's windows-latest CI job actually runs. Confirmed the maui-windows workload ID is valid via dotnet workload search maui and cross-checked each project's TFM/Platforms shape by reading the .csproj files directly.

Related

ahall added 2 commits July 7, 2026 13:01
…ityToolkit#510)

Adds windows-latest CI coverage for the WinUI3, WPF, and MAUI (Windows
TFM) TodoApp heads, plus the todoapp-tutorial ClientApp (WPF) head that
Phase 1 (CommunityToolkit#509) explicitly deferred.

- New build-samples-todoapp-windows.yml builds TodoApp.WinUI3.csproj
  (with -p:Platform=x64, required since the project declares
  x86/x64/ARM64 with no AnyCPU), TodoApp.WPF.csproj, and
  TodoApp.MAUI.csproj scoped to net10.0-windows10.0.19041.0 only (the
  maui-windows workload is installed first; Android/iOS heads remain
  out of scope, tracked in CommunityToolkit#511).
- build-samples-todoapp-tutorial.yml gains a second job that builds
  ClientApp.csproj (WPF) on windows-latest, alongside the existing
  ServerApp job on ubuntu-latest.
- build-samples.yml wires the new todoapp-windows job into the
  orchestrator and its all-samples-built gate.
'dotnet build' on windows-latest (added in this PR's new
build-samples-todoapp-windows.yml job) surfaces NETSDK1198: the
project references a 'win-$(Platform).pubxml' publish profile that
has never existed in the repo (no Properties/PublishProfiles folder
checked in). It's benign scaffold metadata from an incomplete WinUI3
template setup with no effect on 'dotnet build' output, but it's
dangling and unused, so remove it rather than suppress the warning.
@adrianhall

Copy link
Copy Markdown
Collaborator Author

Follow-up fix: the new build-samples-todoapp-windows.yml job surfaced a real (pre-existing) warning on the actual windows-latest runner when building TodoApp.WinUI3:

warning NETSDK1198: A publish profile with the name 'win-x64.pubxml' was not found in the project.

Assessment: not build-breaking — NETSDK1198 is a warning only, the repo has no TreatWarningsAsErrors/WarningsAsErrors policy anywhere, and it doesn't affect dotnet build output. It fires because EnableMsixTooling=true pulls in Microsoft.NET.Publish.targets even during plain build. Root cause: TodoApp.WinUI3.csproj declares <PublishProfile>win-$(Platform).pubxml</PublishProfile>, but no Properties/PublishProfiles/*.pubxml files have ever existed in the repo (confirmed via full-repo search) — dangling scaffold metadata from an incomplete WinUI3 template setup.

Fix (052980a): removed the dangling <PublishProfile> property rather than suppressing the warning code, since nothing currently uses or depends on it and this doesn't reduce any working capability. Validated the resulting csproj is well-formed XML; could not re-run the actual Windows build locally (macOS dev environment), so this will be confirmed clean on the next CI run of this PR.

…-windows

'dotnet restore' has no --framework option; -f on restore means
--force (a boolean flag), unlike 'dotnet build' where -f/--framework
is a real option. Passing '-f net10.0-windows10.0.19041.0' caused
restore to interpret the TFM string as a second positional project
argument, failing with MSB1008 ("Only one project can be specified").
Scope restore to the single Windows TFM via the MSBuild property
instead.
@adrianhall

Copy link
Copy Markdown
Collaborator Author

Follow-up fix: the windows-latest run failed at the "Restore MAUI project (Windows TFM only)" step:

MSBUILD : error MSB1008: Only one project can be specified.

Root cause: dotnet restore has no --framework option. Its -f flag means --force (a boolean, takes no value) — completely different from dotnet build, where -f/--framework <FRAMEWORK> is a real option. Passing -f net10.0-windows10.0.19041.0 to restore caused the TFM string to be parsed as a second positional PROJECT argument, which MSBuild rejected.

Fix (e7c0d42): scope the MAUI restore to the Windows TFM via the MSBuild property directly (-p:TargetFramework=net10.0-windows10.0.19041.0) instead of -f. The corresponding dotnet build ... -f ... step is unaffected — build does support --framework — so it's left as-is.

@adrianhall

Copy link
Copy Markdown
Collaborator Author

Follow-up cleanup filed: the successful windows-latest build of TodoApp.MAUI (Windows TFM) surfaced 5 warning occurrences, deduplicating to 3 unique pre-existing issues in the sample (unrelated to this PR's CI changes — this project simply had no CI building it before). Filed each as a separate issue rather than fixing in this CI-focused PR, to keep this PR single-responsibility:

None of these fail the build (warnings only) or block this PR.

@adrianhall adrianhall merged commit 634cf71 into CommunityToolkit:main Jul 7, 2026
10 checks passed
@adrianhall adrianhall deleted the issues/510 branch July 7, 2026 12:26
adrianhall added a commit that referenced this pull request Jul 7, 2026
* ci: add build-samples workflow for Phase 3 mobile heads (#511)

Adds CI coverage for the Android/iOS/Uno mobile build heads deferred
from Phase 1 (#509/#512) and Phase 2 (#510/#514):

- build-samples-todoapp-avalonia.yml: add android (ubuntu-latest) and
  ios (macos-latest) jobs for TodoApp.Avalonia.Android/.iOS.
- build-samples-todoapp-maui.yml (new): android and ios jobs for
  TodoApp.MAUI, each scoped to a single TargetFramework via
  -p:TargetFramework / -f (the Windows head remains in
  build-samples-todoapp-windows.yml from Phase 2).
- build-samples-todoapp-uno.yml (new): one job per TodoApp.Uno head
  (android, ios+maccatalyst, windows, browserwasm, desktop), each
  restoring/building the single multi-TFM project scoped to one
  TargetFramework at a time.
- build-samples.yml: wire the two new sample workflows into the
  orchestrator and the all-samples-built gate.

The desktop head is intentionally NOT marked continue-on-error here.
#506's NU1903 (Tmds.DBus) finding is a NuGet audit warning only and
this repo does not configure NuGet audit to fail builds. #506 also
reports a NU1605 hit while investigating that warning, but that has
not been confirmed to reproduce today or to be desktop-specific
(CommunityToolkit.WinUI.Behaviors is referenced unconditionally in
TodoApp.Uno.csproj), so all Uno heads are left as normal, blocking
jobs pending real CI signal.

actionlint passes on all 5 changed/new workflow files. Verified
'dotnet restore/build Datasync.Toolkit.sln --configuration Release'
still succeeds with 0 warnings/errors (no regression to the core
library). The mobile/Uno workload installs and builds themselves
cannot be verified locally (no Android SDK, no full Xcode, no
Windows) and will be confirmed once CI runs on this branch.

* fix: align Info.plist MinimumOSVersion with SupportedOSPlatformVersion for TodoApp.Avalonia.iOS

CI (added in #511) surfaced a pre-existing mismatch: Info.plist declared
MinimumOSVersion 13.0 while TodoApp.Avalonia.iOS.csproj declares
SupportedOSPlatformVersion 15.0, which the iOS build task hard-fails on
('The MinimumOSVersion value in the Info.plist (13.0) does not match
the SupportedOSPlatformVersion value (15.0) in the project file').
Bump Info.plist's MinimumOSVersion to 15.0 to match the csproj, which
is treated as the source of truth here.

Unrelated to this fix: the same CI run also surfaced a pre-existing
CS8604 nullable-reference warning in the shared LoggingHandler.cs.
It does not fail the build (the run reported 1 warning, 1 error - only
the Info.plist mismatch was the error) and is left untouched to keep
this change scoped to the actual build failure.

* ci: disable todoapp-uno job pending #506

CI confirmed the NU1605 (Uno.WinUI 5.5.87 vs 5.4.22, driven by
CommunityToolkit.WinUI.Behaviors' floor vs. the Uno.Sdk pin in
global.json) is not desktop-specific as originally suspected in #511 -
it fails restore for every TodoApp.Uno head (confirmed via the
android-head CI log and locally reproduced on net10.0-desktop, no
workload required), since CommunityToolkit.WinUI.Behaviors is
referenced unconditionally in TodoApp.Uno.csproj.

Comment out the todoapp-uno job in build-samples.yml's orchestrator
(and drop it from all-samples-built's needs) rather than trying to
patch around it here. build-samples-todoapp-uno.yml itself is left
fully intact (one job per head, TFM-scoped restore/build) and just
needs to be wired back in once #506 lands a fix and
TodoApp.Uno.csproj restores cleanly.

Posted the concrete reproduction details to #506 so the fix for that
issue also covers re-enabling this CI job.

---------

Co-authored-by: ahall <ahall@cloudflare.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CI workflow to build Windows-only /samples heads (Phase 2 of #509)

1 participant