-
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
Changes from all commits
498a031
bd275e3
8ec902a
4d36283
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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
+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"' | |
| # 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" |
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:
--no-restoreflag on the build commands after the initial restoreThis will significantly speed up the CI build process.