Skip to content

Conversation

Copy link

Copilot AI commented Dec 21, 2025

Adds CI build configuration for the solution in src/ folder, building exclusively for .NET 10 target frameworks.

Implementation

  • Workflow: Runs on windows-latest, triggers on push/PR to main
  • SDKs: Installs .NET 10.0.x only
  • Build strategy: Uses MSBuild /p:TargetFrameworks parameter to override project targets per build

Target Frameworks

Each project builds for .NET 10 only (excluding all older framework versions):

# Standard projects
/p:TargetFrameworks="net10.0"

# SystemDrawing (Windows-specific)
/p:TargetFrameworks="net10.0-windows"

Projects built: DocSharp.Binary.* (Common, Doc, Xls, Ppt), DocSharp.Common, DocSharp.Docx, DocSharp.Markdown, DocSharp.ImageSharp, DocSharp.SystemDrawing

Original prompt

Add github actions build config to https://github.com/stesee/DocSharp primary building solution in "src" folder. Elide builds of that dont target .net 10.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 21, 2025 09:42
Co-authored-by: stesee <168659+stesee@users.noreply.github.com>
Co-authored-by: stesee <168659+stesee@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub Actions build config for DocSharp Add GitHub Actions build workflow excluding .NET 10 targets Dec 21, 2025
Copilot AI requested a review from stesee December 21, 2025 09:46
@stesee
Copy link

stesee commented Dec 21, 2025

@copilot you got it wrong: include. Net 10. Exclude others

Co-authored-by: stesee <168659+stesee@users.noreply.github.com>
Copy link
Author

Copilot AI commented Dec 21, 2025

@copilot you got it wrong: include. Net 10. Exclude others

Fixed in commit 4d36283. The workflow now builds ONLY for .NET 10 targets (net10.0 and net10.0-windows), excluding all older framework versions.

Copilot AI changed the title Add GitHub Actions build workflow excluding .NET 10 targets Add GitHub Actions build workflow for .NET 10 only Dec 21, 2025
@stesee stesee marked this pull request as ready for review December 21, 2025 13:19
Copilot AI review requested due to automatic review settings December 21, 2025 13:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a GitHub Actions CI workflow to build the DocSharp solution targeting .NET 10 exclusively. The workflow uses MSBuild parameters to override the multi-targeted project files to build only for .NET 10, avoiding older framework versions.

Key Changes:

  • Adds new GitHub Actions workflow triggered on push/PR to main branch
  • Configures Windows-based builds using .NET 10.0.x SDK
  • Builds 9 projects individually with framework override parameters

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +32 to +42
dotnet build src/DocSharp.Binary/DocSharp.Binary.Common/DocSharp.Binary.Common.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Doc/DocSharp.Binary.Doc.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Xls/DocSharp.Binary.Xls.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Ppt/DocSharp.Binary.Ppt.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Common/DocSharp.Common.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Docx/DocSharp.Docx.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Markdown/DocSharp.Markdown.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
# ImageSharp for .NET 10
dotnet build src/DocSharp.ImageSharp/DocSharp.ImageSharp.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
# Build Windows-specific projects for .NET 10
dotnet build src/DocSharp.SystemDrawing/DocSharp.SystemDrawing.csproj --configuration Release '/p:TargetFrameworks="net10.0-windows"'
Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow restores dependencies once but then builds each project individually. This approach is inefficient because each individual build command will implicitly restore dependencies again. Consider either:

  1. Using --no-restore flag on the build commands after the initial restore
  2. Or removing the separate restore step and letting the first build command handle restoration

This will significantly speed up the CI build process.

Suggested change
dotnet build src/DocSharp.Binary/DocSharp.Binary.Common/DocSharp.Binary.Common.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Doc/DocSharp.Binary.Doc.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Xls/DocSharp.Binary.Xls.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Ppt/DocSharp.Binary.Ppt.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Common/DocSharp.Common.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Docx/DocSharp.Docx.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Markdown/DocSharp.Markdown.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
# ImageSharp for .NET 10
dotnet build src/DocSharp.ImageSharp/DocSharp.ImageSharp.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
# Build Windows-specific projects for .NET 10
dotnet build src/DocSharp.SystemDrawing/DocSharp.SystemDrawing.csproj --configuration Release '/p:TargetFrameworks="net10.0-windows"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Common/DocSharp.Binary.Common.csproj --configuration Release --no-restore '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Doc/DocSharp.Binary.Doc.csproj --configuration Release --no-restore '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Xls/DocSharp.Binary.Xls.csproj --configuration Release --no-restore '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Ppt/DocSharp.Binary.Ppt.csproj --configuration Release --no-restore '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Common/DocSharp.Common.csproj --configuration Release --no-restore '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Docx/DocSharp.Docx.csproj --configuration Release --no-restore '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Markdown/DocSharp.Markdown.csproj --configuration Release --no-restore '/p:TargetFrameworks="net10.0"'
# ImageSharp for .NET 10
dotnet build src/DocSharp.ImageSharp/DocSharp.ImageSharp.csproj --configuration Release --no-restore '/p:TargetFrameworks="net10.0"'
# Build Windows-specific projects for .NET 10
dotnet build src/DocSharp.SystemDrawing/DocSharp.SystemDrawing.csproj --configuration Release --no-restore '/p:TargetFrameworks="net10.0-windows"'

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +42
# Build projects that target .NET 10 only
dotnet build src/DocSharp.Binary/DocSharp.Binary.Common/DocSharp.Binary.Common.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Doc/DocSharp.Binary.Doc.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Xls/DocSharp.Binary.Xls.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Ppt/DocSharp.Binary.Ppt.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Common/DocSharp.Common.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Docx/DocSharp.Docx.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Markdown/DocSharp.Markdown.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
# ImageSharp for .NET 10
dotnet build src/DocSharp.ImageSharp/DocSharp.ImageSharp.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
# Build Windows-specific projects for .NET 10
dotnet build src/DocSharp.SystemDrawing/DocSharp.SystemDrawing.csproj --configuration Release '/p:TargetFrameworks="net10.0-windows"'
Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building each project individually is verbose and error-prone. The build will not fail fast if an earlier project fails, making it harder to identify build issues. Consider building the solution file instead with the TargetFrameworks override:

dotnet build src/DocSharp.sln --configuration Release --no-restore /p:TargetFrameworks="net10.0"

This single command would build all projects that support net10.0, and for DocSharp.SystemDrawing (which requires net10.0-windows), you could add a separate solution-level build command or continue to build it individually.

Suggested change
# Build projects that target .NET 10 only
dotnet build src/DocSharp.Binary/DocSharp.Binary.Common/DocSharp.Binary.Common.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Doc/DocSharp.Binary.Doc.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Xls/DocSharp.Binary.Xls.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Binary/DocSharp.Binary.Ppt/DocSharp.Binary.Ppt.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Common/DocSharp.Common.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Docx/DocSharp.Docx.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
dotnet build src/DocSharp.Markdown/DocSharp.Markdown.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
# ImageSharp for .NET 10
dotnet build src/DocSharp.ImageSharp/DocSharp.ImageSharp.csproj --configuration Release '/p:TargetFrameworks="net10.0"'
# Build Windows-specific projects for .NET 10
dotnet build src/DocSharp.SystemDrawing/DocSharp.SystemDrawing.csproj --configuration Release '/p:TargetFrameworks="net10.0-windows"'
# Build all projects in the solution that target .NET 10
dotnet build src/DocSharp.sln --configuration Release --no-restore /p:TargetFrameworks="net10.0"
# Build Windows-specific projects (e.g., DocSharp.SystemDrawing) that target .NET 10-windows
dotnet build src/DocSharp.sln --configuration Release --no-restore /p:TargetFrameworks="net10.0-windows"

Copilot uses AI. Check for mistakes.
@stesee stesee closed this Dec 22, 2025
@stesee stesee deleted the copilot/add-github-actions-build-config branch December 22, 2025 22:13
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.

2 participants