Skip to content

Commit 130afb2

Browse files
authored
Feature/hotfix fixing release and package issues (#157)
* #154 Update packaging and build process for CryptoNet - Set `<IsPackable>false</IsPackable>` in `CryptoNet.ExtShared.csproj` and `CryptoNet.Models.csproj` to prevent NuGet packaging. - Bump version in `CryptoNet.csproj` from `3.0.0` to `3.1.9`. - Add `<IncludeReferencedProjects>true</IncludeReferencedProjects>` to include referenced project outputs in the NuGet package. - Add a target to explicitly include referenced DLLs in the package. - Modify asset handling for `CryptoNetLogo-icon.png` to prevent copying to the output directory. - Update `Directory.Build.Props` to conditionally set `<PathMap>` only when `$(SolutionDir)` is defined, avoiding malformed paths. * #154 Update dependencies and project configurations - Upgraded `Microsoft.CodeAnalysis.NetAnalyzers` to `10.0.100`. - Upgraded `System.Text.Json` to `10.0.0` across all projects. - Updated test dependencies: `Microsoft.NET.Test.Sdk`, `NUnit3TestAdapter`, `ReportGenerator`, `SharperHacks.CoreLibs.IO`, `CliWrap`, and `NUnit.Analyzers`. - Added `Microsoft.Build` to `CryptoNet.UnitTests.csproj`. - Enabled embedded debugging with `<DebugType>embedded</DebugType>`. - Re-enabled `<GenerateDocumentationFile>` in `CryptoNet.csproj`. - Centralized versioning in `Directory.Build.Props` and set version to `3.2.0`. - Updated `TargetFramework` to `net8.0` in `Directory.Build.Props`. - Adjusted project references and metadata for consistency. * #154 Improve packaging, debugging, and validation processes - Set `<IsPackable>false</IsPackable>` in `CryptoNet.ExtShared.csproj` and `CryptoNet.Models.csproj` to prevent standalone NuGet packing. - Added `<DebugType>portable</DebugType>` and `<Deterministic>true</Deterministic>` for portable PDBs and deterministic builds. - Downgraded `Microsoft.CodeAnalysis.NetAnalyzers` to 9.0.0 and `System.Text.Json` to 9.0.8 in `CryptoNet.ExtShared.csproj` for compatibility. - Included `.pdb` and `.xml` files for `CryptoNet.ExtShared` and `CryptoNet.Models` in the NuGet package if they exist. - Added NuGet validation script in `run_nuget_validation.ps1` to ensure package quality using `dotnet-validate`. * #154 Enhance build settings and NuGet packaging metadata Updated project files to improve NuGet packaging and SourceLink integration: - Added `<IsPackable>false</IsPackable>` to prevent standalone NuGet packaging. - Included repository metadata (`<RepositoryUrl>` and `<PublishRepositoryUrl>`). - Enabled SourceLink and deterministic build settings with `<EmbedUntrackedSources>` and `<ContinuousIntegrationBuild>`. Refined dependencies: - Added `Microsoft.SourceLink.GitHub` (v8.0.0) for GitHub SourceLink support. - Retained `Microsoft.CodeAnalysis.NetAnalyzers` (v9.0.0) for static analysis. Removed obsolete properties and comments: - Removed `_SkipUpgradeNetAnalyzersNuGetWarning` and outdated comments. Updated `run_nuget_validation.ps1`: - Added `dotnet clean`, `dotnet build`, and `dotnet pack` commands. - Integrated `dotnet-validate` for NuGet package validation. * #154 Simplify project build settings Removed `<DebugType>portable>`, `<Deterministic>`, `<ContinuousIntegrationBuild>`, and `<EmbedUntrackedSources>` from `CryptoNet.ExtShared.csproj` and `CryptoNet.Models.csproj`. These changes simplify the build configuration by removing explicit settings for debug information, deterministic builds, CI build flags, and SourceLink validation. Adjustments may reflect a shift to default or external configurations. * Update dependencies, versions, and target framework - Updated `CryptoNet.ConsumerTest.csproj` to use `CryptoNet` version `3.1.12-preview.20251129.2241`. - Removed the `<Version>` tag from `CryptoNet.ExtPack.csproj` (was `3.0.0`). - Upgraded Visual Studio version in `CryptoNet.sln` to `18.3.11222.16`. - Added `Directory.Build.Props` with updated versioning: - `<Version>`: `3.2.0` → `3.2.5` - `<FileVersion>`: `3.2.0.0` → `3.2.5.0` - `<AssemblyVersion>`: `3.2.0.0` → `3.2.5.0` - Updated target framework in `Directory.Build.Props` to `net8.0`. * Refactor preview tag format and add release script Updated `cd-release-preview.yml` to simplify the regex for preview tag matching. Adjusted `run_release.ps1` to make `PreviewId` and `TagName` NuGet-compliant by removing dots and using the format `vX.Y.Z-previewYYYYMMDDHHmm`. Improved error messaging for version validation. Added `run_release.ps1` to the `DevOps` project in `CryptoNet.sln`.
1 parent fa6324f commit 130afb2

File tree

7 files changed

+17
-14
lines changed

7 files changed

+17
-14
lines changed

.github/workflows/cd-release-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: "2. Continuous Deployment (Release Preview)"
33
on:
44
push:
55
tags:
6-
- "v[0-9]+\\.[0-9]+\\.[0-9]+-preview.*"
6+
- "v[0-9]+\\.[0-9]+\\.[0-9]+-preview*"
77

88
jobs:
99
build:

CryptoNet.ConsumerTest/CryptoNet.ConsumerTest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="CryptoNet" Version="3.1.0" />
11+
<PackageReference Include="CryptoNet" Version="3.1.12-preview.20251129.2241" />
1212
</ItemGroup>
1313

1414
</Project>

CryptoNet.ExtPack/CryptoNet.ExtPack.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<Company>itbackyard</Company>
1818
<Authors>Maytham Fahmi</Authors>
1919
<MinClientVersion>1.0.0</MinClientVersion>
20-
<Version>3.0.0</Version>
2120
<Title>CryptoNet.ExtPack</Title>
2221
<Product>CryptoNet.ExtPack</Product>
2322
<RootNamespace>CryptoNet.ExtPack</RootNamespace>

CryptoNet.sln

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio Version 17
3-
VisualStudioVersion = 17.1.32407.343
2+
# Visual Studio Version 18
3+
VisualStudioVersion = 18.3.11222.16 d18.3
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CryptoNet", "CryptoNet\CryptoNet.csproj", "{8F85375C-A0DC-4B67-B934-F58ED4114F5A}"
66
EndProject
@@ -16,11 +16,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DevOps", "DevOps", "{1733D1
1616
.github\workflows\cd-release.yml = .github\workflows\cd-release.yml
1717
.github\workflows\ci.yml = .github\workflows\ci.yml
1818
.github\workflows\code-coverage.yml = .github\workflows\code-coverage.yml
19+
Directory.Build.Props = Directory.Build.Props
1920
DockerBuild.ps1 = DockerBuild.ps1
2021
Dockerfile = Dockerfile
2122
RELEASE-NOTES = RELEASE-NOTES
2223
run_codecoverage.ps1 = run_codecoverage.ps1
2324
run_codecoverage.txt = run_codecoverage.txt
25+
run_release.ps1 = run_release.ps1
2426
EndProjectSection
2527
EndProject
2628
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Info", "Info", "{6976E2ED-A139-48C5-A390-639F56A8B348}"

CryptoNet/CryptoNet.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
<Copyright>Copyright © 2020</Copyright>
2727
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2828
<EmbedUntrackedSources>true</EmbedUntrackedSources>
29+
<IncludeSymbols>true</IncludeSymbols>
2930
<DebugType>embedded</DebugType>
31+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
3032
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
3133
<_SkipUpgradeNetAnalyzersNuGetWarning>true</_SkipUpgradeNetAnalyzersNuGetWarning>
3234
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
@@ -62,7 +64,7 @@
6264
<ProjectReference Include="..\CryptoNet.Models\CryptoNet.Models.csproj" PrivateAssets="all" />
6365
</ItemGroup>
6466

65-
<Target Name="IncludeReferencedDllsInPackage" BeforeTargets="GenerateNuspec">
67+
<Target Name="IncludeReferencedDllsInPackage" AfterTargets="Build">
6668
<ItemGroup>
6769
<None Include="$(OutputPath)CryptoNet.ExtShared.dll">
6870
<Pack>true</Pack>

Directory.Build.Props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<PropertyGroup>
44
<Authors>Maytham Fahmi and Contributors</Authors>
55
<Copyright>All Rights Reserved</Copyright>
6-
<Version>3.2.0</Version>
7-
<FileVersion>3.2.0.0</FileVersion>
8-
<AssemblyVersion>3.2.0.0</AssemblyVersion>
6+
<Version>3.2.5</Version>
7+
<FileVersion>3.2.5.0</FileVersion>
8+
<AssemblyVersion>3.2.5.0</AssemblyVersion>
99
</PropertyGroup>
1010

1111
<PropertyGroup>

run_release.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ if ($VersionNumber -notmatch '^\d+\.\d+\.\d+$') {
1414
}
1515

1616
# Build preview suffix (valid SemVer identifiers, no leading zeros)
17-
$DatePart = (Get-Date -Format "yyyyMMdd") # e.g. 20250822
18-
$TimePart = (Get-Date -Format "Hmm") # e.g. 845 (not 0845, no leading zero!)
19-
$PreviewId = "$DatePart.$TimePart" # → "20250822.845"
17+
$DatePart = (Get-Date -Format "yyyyMMdd") # e.g 20250822
18+
$TimePart = (Get-Date -Format "Hmm") # e.g 845 (not 0845, no leading zero!)
19+
$PreviewId = "$DatePart$TimePart" # → "20250822845" (no dots!)
2020

2121
# Construct the tag
2222
if ($IsPreview) {
23-
# format: vX.Y.Z-preview.YYYYMMDD.HHmm
24-
$TagName = "v$VersionNumber-preview.$PreviewId"
23+
# format: vX.Y.Z-previewYYYYMMDDHHmm (NuGet-compliant)
24+
$TagName = "v$VersionNumber-preview$PreviewId"
2525
} else {
2626
$TagName = "v$VersionNumber"
2727
}

0 commit comments

Comments
 (0)