-
Notifications
You must be signed in to change notification settings - Fork 0
Add GitHub Actions build workflow for .NET 10 only #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: stesee <168659+stesee@users.noreply.github.com>
Co-authored-by: stesee <168659+stesee@users.noreply.github.com>
|
@copilot you got it wrong: include. Net 10. Exclude others |
Co-authored-by: stesee <168659+stesee@users.noreply.github.com>
There was a problem hiding this 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.
| 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"' |
Copilot
AI
Dec 21, 2025
There was a problem hiding this comment.
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:
- Using
--no-restoreflag on the build commands after the initial restore - Or removing the separate restore step and letting the first build command handle restoration
This will significantly speed up the CI build process.
| 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"' |
| # 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"' |
Copilot
AI
Dec 21, 2025
There was a problem hiding this comment.
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.
| # 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" |
Adds CI build configuration for the solution in
src/folder, building exclusively for .NET 10 target frameworks.Implementation
windows-latest, triggers on push/PR to main/p:TargetFrameworksparameter to override project targets per buildTarget Frameworks
Each project builds for .NET 10 only (excluding all older framework versions):
Projects built: DocSharp.Binary.* (Common, Doc, Xls, Ppt), DocSharp.Common, DocSharp.Docx, DocSharp.Markdown, DocSharp.ImageSharp, DocSharp.SystemDrawing
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.