Skip to content

Commit e72480a

Browse files
Query builder signing and upload to nuget (#2)
* Set up CI with Azure Pipelines [skip ci] * Add pipeline to build and sign * Change signing certificate password * Change to versionSpec parameter * Add versionSpec to gitversion task * Change git version to 5.x * Change to windows-latest * Do not use shallow depth fetch in git * Edit .csproj file location * Change to snk signing * Fix secure file path * Add pr related versioning * Add pipeline run name * Add signing of dlls * Change order of operations * WIP list dll files location * WIP update debug step * Update output directory * Use powershell for build * Edit signtool logic * Modify dotnet build step * Comment out debug step * Use powershell to build * Add build step * Change pack task * Fix debug dotnet build * Update output directory * remove breaking tick * Change name of build task * Publish signed DLLs as artifacts * Fix signing logic * WIP check if dlls are signed properly * wip find signtool * wip verify every single dll is signed * Remove verification step * Edit nuget service connection * Sign the nuget package + some pipeline refactoring * Fix path to the signing certificate * try referencing the password correctly * Refactor project building * Try to wildcard the name of the nupkg files * Tweak the csproj file with versioning & NuGet authoting attributes * Explicitly set the assembly version attributes at runtime * tweak the dotnet build task * Update azure-pipelines.yml for Azure Pipelines * try to refactor the call to dotnet build again * Changes related to the nuget package authoring * Tweak nuget authoring & licensing attributes * fix build step * debug git version step * build targetting csproj * Hard core sign tool location * use dotnet task to build * Tweak nuget authoring & licensing attributes some more * Add doc url to .csproj * Add tags to the metadata * Remove Livense.txt from the build * Remove license txt * Include package reference * Revert adding package reference * wip check nuget version * revert nuget version check * dotnet pack include documentation file * revert include documentation file * Add explicit MIT license * Minor touch-ups * Move pipeline to azure-pipelines location * Delete old azure-pipelines.yml * Edit package project url in csproj * Add igniteui icon * Add icon to csproj * Use png instead of ico * Delete IgniteUI.ico * Add ingnite ui icon png * Delete IgniteUI.png * Add icon 128 * add package path parameter in csproj * Add extra space * Add automated documentation generation * Fix indentation * Fix trigger and intentation * Update name * Add publish step * Delete License.txt * Delete IgniteUI.png * Upload ignite ui icon * Stop using git version * Publish nuget package * quotes around releaseTag * Use cleaner SourceBranchName --------- Co-authored-by: Borislav Traykov <[email protected]> Co-authored-by: Borislav Traykov <[email protected]>
1 parent aec2d07 commit e72480a

File tree

3 files changed

+148
-0
lines changed

3 files changed

+148
-0
lines changed

IgniteUI.png

6.24 KB
Loading

Infragistics.QueryBuilder.Executor.csproj

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,36 @@
44
<TargetFramework>net9.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7+
<PackageId>Infragistics.QueryBuilder.Executor</PackageId>
8+
<Authors>Infragistics Inc.</Authors>
9+
<Owners>Infragistics Inc.</Owners>
10+
<Company>Infragistics Inc.</Company>
11+
<Description>A .NET 9 library for dynamic, strongly-typed query building and execution over Entity Framework Core data sources. Supports advanced filtering, projection, and SQL generation.</Description>
12+
<Version>1.0.0.0</Version>
13+
<!-->We want to generate the version attributes at runtime and we need this flag enabled for that<-->
14+
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
15+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
16+
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
17+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
18+
<Copyright>Infragistics</Copyright>
19+
<PackageReadmeFile>ReadMe.md</PackageReadmeFile>
20+
<PackageProjectUrl>https://github.com/IgniteUI/Infragistics.QueryBuilder.Executor</PackageProjectUrl>
21+
<RepositoryUrl>https://github.com/IgniteUI/Infragistics.QueryBuilder.Executor</RepositoryUrl>
22+
<RepositoryType>git</RepositoryType>
23+
<PackageDocumentationUrl>https://github.com/IgniteUI/Infragistics.QueryBuilder.Executor</PackageDocumentationUrl>
24+
<PackageTags>Infragistics;App Builder;Ignite UI;Filtering;Query;Query Builder;Models</PackageTags>
25+
<PackageIcon>IgniteUI.png</PackageIcon>
726
</PropertyGroup>
827

928
<ItemGroup>
1029
<PackageReference Include="AutoMapper" Version="14.0.0" />
1130
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.4" />
1231
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="8.1.1" />
32+
<None Include="IgniteUI.png" Pack="true" PackagePath="" />
33+
<None Include="ReadMe.md">
34+
<Pack>True</Pack>
35+
<PackagePath></PackagePath>
36+
</None>
1337
</ItemGroup>
1438

1539
</Project>
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
trigger:
2+
tags:
3+
include:
4+
- '*'
5+
# This pipeline is meant to build & deploy upon tagging. It's not meant to be a part of PR validation.
6+
pr: none
7+
8+
name: $(Build.SourceBranchName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
9+
10+
variables:
11+
- group: Code_Signing_Certificate_2023_2026
12+
- name: prId
13+
value: $[coalesce(variables['System.PullRequest.PullRequestId'], '000')]
14+
- name: prIteration
15+
value: $[counter(variables['prId'], 1)]
16+
- name: buildConfiguration
17+
value: Release
18+
- name: releaseTag
19+
value: $(Build.SourceBranchName)
20+
21+
stages:
22+
- stage: BuildAndPublish
23+
condition: succeeded()
24+
jobs:
25+
- job: BuildAndSign
26+
pool:
27+
vmImage: 'windows-latest'
28+
29+
steps:
30+
- checkout: self
31+
fetchDepth: 0
32+
33+
- task: UseDotNet@2
34+
inputs:
35+
packageType: 'sdk'
36+
version: '9.x'
37+
38+
- task: DownloadSecureFile@1
39+
name: cert
40+
inputs:
41+
secureFile: 'code-signing-certificate-2023-2026.pfx'
42+
43+
- task: DotNetCoreCLI@2
44+
displayName: 'Build Project'
45+
inputs:
46+
command: 'build'
47+
projects: 'Infragistics.QueryBuilder.Executor.csproj'
48+
arguments: >
49+
-c $(buildConfiguration)
50+
/p:Version=$(releaseTag)
51+
52+
- powershell: |
53+
$outputDir = "$(Build.SourcesDirectory)\bin\$(buildConfiguration)\net9.0"
54+
Write-Host "Listing contents of: $outputDir"
55+
if (-Not (Test-Path $outputDir)) {
56+
Write-Error "Output folder not found: $outputDir"
57+
exit 1
58+
}
59+
Get-ChildItem $outputDir -Recurse | ForEach-Object {
60+
Write-Host $_.FullName
61+
}
62+
displayName: 'Debug: List build output contents'
63+
64+
- powershell: |
65+
$dllFolder = "$(Build.SourcesDirectory)\bin\$(buildConfiguration)\net9.0"
66+
Write-Host "Signing DLLs in folder: $dllFolder"
67+
68+
$signtoolPath = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64\signtool.exe"
69+
Write-Host "Using signtool at: $signtoolPath"
70+
71+
$dllFiles = Get-ChildItem -Path $dllFolder -Filter *.dll -Recurse
72+
foreach ($dll in $dllFiles) {
73+
Write-Host "Signing $($dll.FullName)..."
74+
& $signtoolPath sign /f $(cert.secureFilePath) /p $env:CERT_PASS /tr $(SigningCertificateTimestampUrl) /td sha256 /fd sha256 $dll.FullName
75+
76+
if ($LASTEXITCODE -ne 0) {
77+
Write-Error "Signing failed for $($dll.FullName)"
78+
exit 1
79+
}
80+
}
81+
displayName: 'Sign all DLL files with PFX certificate'
82+
env:
83+
CERT_PASS: $(SigningCertificatePassword)
84+
85+
- powershell: |
86+
$packageOutputDir = "$(Build.ArtifactStagingDirectory)\nuget"
87+
$packageVersion = "$(releaseTag)"
88+
89+
Write-Host "Packing project from existing build output..."
90+
dotnet pack ./Infragistics.QueryBuilder.Executor.csproj `
91+
--no-build `
92+
--configuration $(buildConfiguration) `
93+
-p:PackageVersion=$packageVersion `
94+
-o $packageOutputDir
95+
96+
if ($LASTEXITCODE -ne 0) {
97+
Write-Error "dotnet pack failed"
98+
exit 1
99+
}
100+
displayName: 'Pack NuGet Package using PowerShell'
101+
102+
- task: PowerShell@2
103+
displayName: 'Sign NuGet package'
104+
env:
105+
CERT_PASS: $(SigningCertificatePassword)
106+
inputs:
107+
targetType: 'inline'
108+
script: |
109+
nuget.exe sign $(Build.ArtifactStagingDirectory)\nuget\*.nupkg -CertificatePath $(cert.secureFilePath) -CertificatePassword $env:CERT_PASS -Timestamper $(SigningCertificateTimestampUrl)
110+
111+
- task: PublishBuildArtifacts@1
112+
inputs:
113+
PathtoPublish: '$(Build.ArtifactStagingDirectory)/nuget'
114+
ArtifactName: 'NuGetPackage'
115+
publishLocation: 'Container'
116+
displayName: 'Publish NuGet Package as Build Artifact'
117+
118+
- task: NuGetCommand@2
119+
inputs:
120+
command: 'push'
121+
packagesToPush: '$(Build.ArtifactStagingDirectory)/nuget/*.nupkg'
122+
nuGetFeedType: 'external'
123+
publishFeedCredentials: 'NuGet.Org'
124+
displayName: 'Publish to NuGet.org'

0 commit comments

Comments
 (0)