Skip to content
Closed
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
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build:
runs-on: windows-latest

permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET SDK (only .NET 10)
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Restore dependencies
run: dotnet restore src/DocSharp.sln

- name: Build projects (only .NET 10 targets)
run: |
# 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"'
Comment on lines +32 to +42
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
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.
shell: pwsh
Loading