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
35 changes: 27 additions & 8 deletions .github/workflows/build-samples-todoapp-tutorial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_CONFIGURATION: 'Release'
# NOTE: This sample's solution (todoapp.sln) also contains ClientApp, a WPF project
# targeting net10.0-windows. That head requires a windows-latest runner and is tracked
# separately in https://github.com/CommunityToolkit/Datasync/issues/510 (Phase 2). Only
# ServerApp (net10.0) is built here.
ProjectFile: 'samples/todoapp-tutorial/ServerApp/ServerApp.csproj'
ServerProjectFile: 'samples/todoapp-tutorial/ServerApp/ServerApp.csproj'
# ClientApp is a WPF project targeting net10.0-windows, so it is built on a windows-latest
# runner in a separate job below. See https://github.com/CommunityToolkit/Datasync/issues/510.
ClientProjectFile: 'samples/todoapp-tutorial/ClientApp/ClientApp.csproj'

permissions:
contents: read

jobs:
build:
build-serverapp:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
Expand All @@ -30,10 +29,30 @@ jobs:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore dependencies
run: dotnet restore ${{ env.ProjectFile }}
run: dotnet restore ${{ env.ServerProjectFile }}

- name: Build sample
run: >
dotnet build ${{ env.ProjectFile }}
dotnet build ${{ env.ServerProjectFile }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore

build-clientapp:
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 dependencies
run: dotnet restore ${{ env.ClientProjectFile }}

- name: Build sample
run: >
dotnet build ${{ env.ClientProjectFile }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore
69 changes: 69 additions & 0 deletions .github/workflows/build-samples-todoapp-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build Sample - TodoApp Windows (WinUI3 / WPF / MAUI)

on:
workflow_call:

env:
DOTNET_VERSION: '10.0.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
DOTNET_CONFIGURATION: 'Release'
# WinUI3 declares <Platforms>x86;x64;ARM64</Platforms> with no AnyCPU, so Platform must be
# specified explicitly - the CLI default of AnyCPU is not a valid configuration for this project.
WinUI3ProjectFile: 'samples/todoapp/TodoApp.WinUI3/TodoApp.WinUI3.csproj'
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.
MauiProjectFile: 'samples/todoapp/TodoApp.MAUI/TodoApp.MAUI.csproj'
MauiWindowsTargetFramework: 'net10.0-windows10.0.19041.0'

permissions:
contents: read

jobs:
build:
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 WinUI3 project
run: dotnet restore ${{ env.WinUI3ProjectFile }} -p:Platform=x64

- name: Build WinUI3 project
run: >
dotnet build ${{ env.WinUI3ProjectFile }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
-p:Platform=x64
--no-restore

- name: Restore WPF project
run: dotnet restore ${{ env.WpfProjectFile }}

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

- name: Install MAUI Windows workload
run: dotnet workload install maui-windows

- name: Restore MAUI project (Windows 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.MauiWindowsTargetFramework }}

- name: Build MAUI project (Windows TFM only)
run: >
dotnet build ${{ env.MauiProjectFile }}
-f ${{ env.MauiWindowsTargetFramework }}
--configuration ${{ env.DOTNET_CONFIGURATION }}
--no-restore
8 changes: 6 additions & 2 deletions .github/workflows/build-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ jobs:
todoapp-avalonia:
uses: ./.github/workflows/build-samples-todoapp-avalonia.yml

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

# Single aggregation point so branch protection only needs to require one check,
# regardless of how many sample workflows are added over time (see Phase 2/3
# follow-ups: https://github.com/CommunityToolkit/Datasync/issues/510 and #511).
# regardless of how many sample workflows are added over time (see Phase 3
# follow-up: https://github.com/CommunityToolkit/Datasync/issues/511).
all-samples-built:
name: All samples built
if: always()
Expand All @@ -44,6 +47,7 @@ jobs:
- todoapp-blazor-wasm
- todoapp-tutorial
- todoapp-avalonia
- todoapp-windows
runs-on: ubuntu-latest
steps:
- name: Check sample build results
Expand Down
1 change: 0 additions & 1 deletion samples/todoapp/TodoApp.WinUI3/TodoApp.WinUI3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
<LangVersion>preview</LangVersion>
Expand Down
Loading