Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
65 changes: 65 additions & 0 deletions .github/workflows/_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build
on:
workflow_call:
inputs:
project-path:
required: true
type: string
description: 'Path to the solution filter or project to build'
project-name:
required: true
type: string
description: 'Human-readable name for artifact naming'
run-tests:
required: false
type: boolean
default: true
pack:
required: false
type: boolean
default: false

jobs:
build:
strategy:
matrix:
os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

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

- name: Restore
run: dotnet restore ${{ inputs.project-path }}

- name: Build
run: dotnet build ${{ inputs.project-path }} -c Release --no-restore

- name: Test
if: inputs.run-tests
run: dotnet test ${{ inputs.project-path }} -c Release --no-build --logger trx --results-directory TestResults

- name: Upload test results
if: inputs.run-tests && always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ inputs.project-name }}-${{ matrix.os }}
path: TestResults/**/*.trx

- name: Pack
if: inputs.pack && matrix.os == 'windows-latest'
run: dotnet pack ${{ inputs.project-path }} -c Release --no-build -o ./artifacts

- name: Upload packages
if: inputs.pack && matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: packages-${{ inputs.project-name }}
path: ./artifacts/*.nupkg
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
pull_request:
branches: [main]

jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
devflow: ${{ steps.changes.outputs.devflow }}
infra: ${{ steps.changes.outputs.infra }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
devflow:
- 'src/DevFlow/**'
infra:
- 'eng/**'
- 'Directory.Build.props'
- 'Directory.Build.targets'
- 'Directory.Packages.props'
- 'global.json'
- 'NuGet.config'

build-devflow:
needs: detect-changes
if: needs.detect-changes.outputs.devflow == 'true' || needs.detect-changes.outputs.infra == 'true'
uses: ./.github/workflows/_build.yml
with:
project-path: src/DevFlow/DevFlow.slnf
project-name: devflow
run-tests: true
pack: true
94 changes: 94 additions & 0 deletions .github/workflows/release-devflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Release DevFlow

on:
push:
tags:
- 'devflow/v*'
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g. 1.0.0-preview.1)'
required: true
type: string

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Determine version
id: version
shell: pwsh
run: |
if ("${{ github.event_name }}" -eq "push") {
$tag = "${{ github.ref_name }}"
$version = $tag -replace '^devflow/v', ''
} else {
$version = "${{ github.event.inputs.version }}"
}
echo "version=$version" >> $env:GITHUB_OUTPUT
echo "Releasing DevFlow v$version"

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

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

- name: Restore
run: dotnet restore src/DevFlow/DevFlow.slnf

- name: Build
run: dotnet build src/DevFlow/DevFlow.slnf -c Release --no-restore

- name: Test
run: dotnet test src/DevFlow/DevFlow.slnf -c Release --no-build

- name: Pack
shell: pwsh
run: |
$version = "${{ steps.version.outputs.version }}"
Get-ChildItem src/DevFlow -Filter *.csproj -Recurse |
Where-Object { $_.Directory.Name -ne 'Microsoft.Maui.DevFlow.Tests' } |
ForEach-Object {
dotnet pack $_.FullName -c Release --no-build -o ./artifacts -p:PackageVersion=$version
}

- name: Upload packages
uses: actions/upload-artifact@v4
with:
name: devflow-packages
path: ./artifacts/*.nupkg

publish:
needs: build
runs-on: ubuntu-latest
environment: nuget-publish
steps:
- name: Download packages
uses: actions/download-artifact@v4
with:
name: devflow-packages
path: ./artifacts

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Push to NuGet
run: |
dotnet nuget push ./artifacts/*.nupkg \
--source https://api.nuget.org/v3/index.json \
--api-key ${{ secrets.NUGET_API_KEY }} \
--skip-duplicate

- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: ./artifacts/*.nupkg
generate_release_notes: true
97 changes: 97 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Contributing to .NET MAUI Labs

Thank you for your interest in contributing! This repository hosts experimental .NET MAUI packages that are in active development.

## Repository Structure

```
maui-labs/
├── src/ # Source code, organized by product
│ └── {Product}/ # Each product has its own folder
│ ├── Version.props # Per-product version
│ ├── {Product}.slnf # Solution filter for this product
│ └── ...projects...
├── samples/ # Sample apps (not shipped)
├── playground/ # Manual verification/scratch apps
├── docs/ # Documentation per product
├── eng/ # Shared build infrastructure
└── MauiLabs.sln # Full solution
```

## Getting Started

### Prerequisites

- [.NET 10 SDK](https://dotnet.microsoft.com/download/dotnet/10.0) (see `global.json` for exact version)
- MAUI workload: `dotnet workload install maui`

### Building

```bash
# Build everything
dotnet build MauiLabs.sln

# Build just one product (e.g., DevFlow)
dotnet build src/DevFlow/DevFlow.slnf

# Build a specific project
dotnet build src/DevFlow/Microsoft.Maui.DevFlow.Agent.Core/
```

### Running Tests

```bash
# All tests
dotnet test MauiLabs.sln

# Just DevFlow tests
dotnet test src/DevFlow/Microsoft.Maui.DevFlow.Tests/
```

### Opening in an IDE

For focused development on a single product, open the solution filter:

- **DevFlow**: `src/DevFlow/DevFlow.slnf`

For the full repo, open `MauiLabs.sln`.

## Adding a New Product

1. Create `src/{NewProduct}/` with:
- `Version.props` (copy from an existing product)
- Project folders with `.csproj` files
- Test project
- `{NewProduct}.slnf` solution filter
2. Add projects to `MauiLabs.sln`
3. Add any new package versions to `Directory.Packages.props`
4. Add path filter entry in `.github/workflows/ci.yml`
5. Create `.github/workflows/release-{newproduct}.yml`

## Versioning

Each product manages its own version in `src/{Product}/Version.props`:

```xml
<Project>
<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix>preview.1</VersionSuffix>
</PropertyGroup>
</Project>
```

## Package Management

This repo uses [Central Package Management](https://learn.microsoft.com/nuget/consume-packages/central-package-management). All package versions are defined in `Directory.Packages.props` at the repo root. Individual `.csproj` files reference packages without specifying versions.

## Code Style

- `ImplicitUsings` and `Nullable` are enabled repo-wide
- Follow standard .NET naming conventions

## Pull Requests

- PRs trigger CI builds only for products with changed files
- Ensure tests pass before requesting review
- Update `Version.props` if your change warrants a version bump
25 changes: 25 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project>

<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<!-- Import shared packaging properties for NuGet packages -->
<Import Project="$(MSBuildThisFileDirectory)eng/Common.props" />

<!-- Common SupportedOSPlatformVersion for all MAUI projects -->
<PropertyGroup Condition="'$(UseMaui)' == 'true'">
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
</PropertyGroup>

<!-- macOS AppKit (net10.0-macos) support -->
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'macos'">
<SupportedOSPlatformVersion>14.0</SupportedOSPlatformVersion>
<DefineConstants>$(DefineConstants);MACOS</DefineConstants>
</PropertyGroup>

</Project>
5 changes: 5 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>

<Import Project="$(MSBuildThisFileDirectory)eng/Common.targets" />

</Project>
Loading