Skip to content

Commit c01152d

Browse files
committed
Enhance CI/CD pipeline with NuGet package validation and symbol generation
1 parent 6969704 commit c01152d

File tree

3 files changed

+27
-11
lines changed

3 files changed

+27
-11
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
1212
DOTNET_NOLOGO: true
1313
DOTNET_CLI_TELEMETRY_OPTOUT: true
14+
CI: true
1415

1516
jobs:
1617
build:
@@ -170,11 +171,7 @@ jobs:
170171
path: ./packages/*.nupkg
171172
retention-days: 30
172173

173-
- name: Validate package
174-
run: |
175-
echo "📦 Validating NuGet package..."
176-
for package in ./packages/*.nupkg; do
177-
echo "Validating: $package"
178-
dotnet tool install --global dotnet-validate --version 0.0.1-preview.537
179-
dotnet validate package local "$package"
180-
done
174+
- name: Validate NuGet Package
175+
uses: NuGetPackageExplorer/ValidatePackage@v1
176+
with:
177+
packagePath: ./packages/NLWebNet.1.0.0-alpha.nupkg

doc/todo.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ The demo application is now fully functional with a modern .NET 9 Blazor Web App
4949
-**Build Fixes**: Resolved App.razor build warnings by adding proper @using directives and removing duplicate files
5050
-**CI/CD Testing Fix**: Updated GitHub Actions workflow to gracefully handle missing test projects and prevent build failures
5151
-**CI/CD Packaging Fix**: Added Release build step to package-validation job to ensure NuGet DLL is available for packaging
52+
-**CI/CD Symbol Generation**: Fixed NuGet package validation by adding proper symbol generation, deterministic builds, and Source Link integration
5253

5354
The next phase focuses on implementing the core NLWeb library functionality.
5455

@@ -94,11 +95,13 @@ The next phase focuses on implementing the core NLWeb library functionality.
9495
- [x] Add proper validation attributes and JSON serialization settings
9596
- [x] Set up CI/CD pipeline:
9697
- [x] GitHub Actions workflow for automated builds and testing
97-
- [x] Multi-configuration builds (Debug/Release)
98+
- [x] Multi-configuration builds (Debug/Release) → Optimized to Release-only
9899
- [x] Code quality checks and formatting validation
99100
- [x] Security scanning for vulnerable packages
100101
- [x] NuGet package creation and validation
101102
- [x] Build status badge in README
103+
- [x] Symbol generation and deterministic builds for package validation
104+
- [x] Source Link integration for GitHub repository
102105

103106
### Phase 3: Business Logic Layer (Library)
104107

src/NLWebNet/NLWebNet.csproj

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
1+
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup>
32
<TargetFramework>net9.0</TargetFramework>
43
<Nullable>enable</Nullable>
54
<ImplicitUsings>enable</ImplicitUsings>
65
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
6+
7+
<!-- Package Metadata -->
78
<PackageId>NLWebNet</PackageId>
89
<PackageVersion>1.0.0-alpha</PackageVersion>
910
<Authors>NLWebNet Contributors</Authors>
@@ -12,6 +13,18 @@
1213
<RepositoryUrl>https://github.com/your-org/NLWebNet</RepositoryUrl>
1314
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1415
<PackageReadmeFile>README.md</PackageReadmeFile>
16+
17+
<!-- Symbol and Deterministic Build Configuration -->
18+
<IncludeSymbols>true</IncludeSymbols>
19+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
20+
<DebugType>portable</DebugType>
21+
<DebugSymbols>true</DebugSymbols>
22+
<Deterministic>true</Deterministic>
23+
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild>
24+
25+
<!-- Source Link Configuration -->
26+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
27+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1528
</PropertyGroup> <ItemGroup>
1629
<PackageReference Include="Microsoft.Extensions.AI" Version="9.5.0" />
1730
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.3.0" />
@@ -20,6 +33,9 @@
2033
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.5" />
2134
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.5" />
2235
<PackageReference Include="ModelContextProtocol" Version="0.2.0-preview.3" />
36+
37+
<!-- Source Link for GitHub -->
38+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
2339
</ItemGroup>
2440

2541
<ItemGroup>

0 commit comments

Comments
 (0)