Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions .github/workflows/cd-release-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ name: "2. Continuous Deployment (Release Preview)"
on:
push:
tags:
- "v[0-9]+\\.[0-9]+\\.[0-9]+-preview[0-9]+\\.[0-9]+"
- "v[0-9]+\\.[0-9]+\\.[0-9]+-preview.*"

jobs:
build:
runs-on: ubuntu-latest

timeout-minutes: 15

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "2. Continuous Deployment (Release)"
name: "2. Continuous Deployment (Release)"

on:
push:
Expand Down
25 changes: 13 additions & 12 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: "3. Code Coverage"

permissions:
contents: write

on:
push:
branches:
Expand All @@ -22,6 +25,7 @@ jobs:
with:
ref: ${{ github.ref }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand Down Expand Up @@ -55,25 +59,22 @@ jobs:
name: code-coverage-badge
path: coverage/badge_linecoverage.svg

- name: Commit coverage badge
- name: Commit coverage badge (only on main)
if: github.ref == 'refs/heads/main'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
# Copy badge to root directory
find . -name badge_linecoverage.svg || echo "Badge not found"
cp coverage/badge_linecoverage.svg ./coverage-badge.svg
# Force add badge and commit
git add -f coverage-badge.svg
if git diff-index --cached --quiet HEAD; then
echo "No changes to commit"
git add coverage-badge.svg
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m 'Update coverage badge'
git push --force
git commit -m "Update coverage badge"
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Print Directory Structure
uses: FiorelaCiroku/[email protected]
14 changes: 14 additions & 0 deletions CryptoNet.ConsumerTest/CryptoNet.ConsumerTest.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CryptoNet" Version="3.0.25-preview.20250822.1051" />
</ItemGroup>

</Project>
11 changes: 11 additions & 0 deletions CryptoNet.ConsumerTest/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace CryptoNet.ConsumerTest
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("This is only to test if the latest Nuget package is consumable for nuget.net");
//todo: implement a test that uses the CryptoNet library
}
}
}
4 changes: 2 additions & 2 deletions CryptoNet.ExtShared/CryptoNet.ExtShared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" PrivateAssets="All" />
<PackageReference Include="System.Text.Json" Version="9.0.8" />
</ItemGroup>

<ItemGroup>
Expand Down
20 changes: 10 additions & 10 deletions CryptoNet.UnitTests/CryptoNet.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Core" Version="8.0.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Core" Version="9.0.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.1.0" />
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="ReportGenerator" Version="5.4.3" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="SharperHacks.CoreLibs.IO" Version="5.0.2" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="ReportGenerator" Version="5.4.12" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="SharperHacks.CoreLibs.IO" Version="7.0.3" />
<PackageReference Include="System.Text.Json" Version="9.0.8" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 7 additions & 0 deletions CryptoNet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DevOps", "DevOps", "{1733D1
.gitattributes = .gitattributes
.gitignore = .gitignore
build.ps1 = build.ps1
.github\workflows\cd-release-preview.yml = .github\workflows\cd-release-preview.yml
.github\workflows\cd-release.yml = .github\workflows\cd-release.yml
.github\workflows\ci.yml = .github\workflows\ci.yml
.github\workflows\code-coverage.yml = .github\workflows\code-coverage.yml
Expand Down Expand Up @@ -47,6 +48,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.UnitTests", "Examp
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DSAExample", "Examples\DSAExample\DSAExample.csproj", "{7338899C-D3F0-4268-AAE8-45793979D936}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CryptoNet.ConsumerTest", "CryptoNet.ConsumerTest\CryptoNet.ConsumerTest.csproj", "{6BBC4487-140E-44E1-9703-F9F48E805589}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -89,6 +92,10 @@ Global
{7338899C-D3F0-4268-AAE8-45793979D936}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7338899C-D3F0-4268-AAE8-45793979D936}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7338899C-D3F0-4268-AAE8-45793979D936}.Release|Any CPU.Build.0 = Release|Any CPU
{6BBC4487-140E-44E1-9703-F9F48E805589}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6BBC4487-140E-44E1-9703-F9F48E805589}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6BBC4487-140E-44E1-9703-F9F48E805589}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6BBC4487-140E-44E1-9703-F9F48E805589}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
8 changes: 4 additions & 4 deletions CryptoNet/CryptoNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" PrivateAssets="All" />
<PackageReference Include="System.Text.Json" Version="9.0.8" />
</ItemGroup>

<ItemGroup>
Expand All @@ -59,8 +59,8 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CryptoNet.ExtShared\CryptoNet.ExtShared.csproj" />
<ProjectReference Include="..\CryptoNet.Models\CryptoNet.Models.csproj" />
<ProjectReference Include="..\CryptoNet.ExtShared\CryptoNet.ExtShared.csproj" PrivateAssets="all" />
<ProjectReference Include="..\CryptoNet.Models\CryptoNet.Models.csproj" PrivateAssets="all" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Examples/AESExample/AESExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="System.Text.Json" Version="9.0.8" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 0 additions & 2 deletions Examples/DSAExample/DSAExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

using CryptoNet;
using CryptoNet.ExtShared;
using System.Runtime.InteropServices;


var confidentialMessage = "Watson, can you hear me?";

Expand Down
3 changes: 2 additions & 1 deletion Examples/DSAExample/DSAExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="System.Text.Json" Version="9.0.8" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\CryptoNet\CryptoNet.csproj" />
<ProjectReference Include="..\..\CryptoNet.ExtShared\CryptoNet.ExtShared.csproj" />
</ItemGroup>
</Project>
18 changes: 9 additions & 9 deletions Examples/Examples.UnitTests/Examples.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CliWrap" Version="3.7.0" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="CliWrap" Version="3.9.0" />
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PackageReference Include="coverlet.msbuild" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="NUnit.Analyzers" Version="4.5.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.10.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="SharperHacks.CoreLibs.IO" Version="5.0.2" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="NUnit3TestAdapter" Version="5.1.0" />
<PackageReference Include="SharperHacks.CoreLibs.IO" Version="7.0.3" />
<PackageReference Include="System.Text.Json" Version="9.0.8" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Examples/RSAExample/RSAExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="System.Text.Json" Version="9.0.8" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ _layout: landing
[![CryptoNet NuGet version](https://img.shields.io/nuget/v/CryptoNet?color=blue)](https://www.nuget.org/packages/CryptoNet/)
[![Passing build workflow](https://github.com/itbackyard/CryptoNet/actions/workflows/1-ci.yml/badge.svg)](https://github.com/itbackyard/CryptoNet/actions/workflows/1-ci.yml)
[![Generic badge](https://img.shields.io/badge/support-.NET%20Standard%202.0-blue.svg)](https://github.com/itbackyard/CryptoNet)
![Code Coverage](./coverage-badge.svg)
![Code Coverage](https://raw.githubusercontent.com/itbackyard/CryptoNet/refs/heads/main/coverage-badge.svg)
[![Build status](https://ci.appveyor.com/api/projects/status/31lrxbhyua22dhq3/branch/main?svg=true)](https://ci.appveyor.com/project/maythamfahmi/cryptonet/branch/main)

# Introduction
Expand Down
9 changes: 7 additions & 2 deletions run_docs.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Remove-Item .\api -Recurse
Remove-Item .\_site\. -Recurse
if (Test-Path ".\api") {
Remove-Item ".\api" -Recurse -Force
}

if (Test-Path ".\_site") {
Remove-Item ".\_site" -Recurse -Force
}
docfx metadata
docfx build .\docfx.json

Expand Down
36 changes: 19 additions & 17 deletions run_release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,47 @@
param(
[Parameter(Mandatory = $true, HelpMessage = "Provide the version number in the format 'X.Y.Z', e.g., '3.0.0'.")]
[string]$VersionNumber,

[Parameter(Mandatory = $true)]
[bool]$IsPreview
)

# Validate the input format
# Validate version number format X.Y.Z
if ($VersionNumber -notmatch '^\d+\.\d+\.\d+$') {
Write-Host "Error: Version number must be in the format 'X.Y.Z', e.g., '3.0.0'." -ForegroundColor Red
Write-Host "Error: Version number must be in the format 'X.Y.Z', e.g., '3.0.0'." -ForegroundColor Red
exit 1
}

# Generate PreviewVersion dynamically
$Timestamp = (Get-Date -Format "ddMMyy")
$Time = (Get-Date -Format "HHmm")
$PreviewVersion = "$Timestamp.$Time"
# Build preview suffix (valid SemVer identifiers, no leading zeros)
$DatePart = (Get-Date -Format "yyyyMMdd") # e.g. 20250822
$TimePart = (Get-Date -Format "Hmm") # e.g. 845 (not 0845, no leading zero!)
$PreviewId = "$DatePart.$TimePart" # → "20250822.845"

# Construct the tag and message dynamically
# Construct the tag
if ($IsPreview) {
$TagName = "v$VersionNumber-preview$PreviewVersion"
# format: vX.Y.Z-preview.YYYYMMDD.HHmm
$TagName = "v$VersionNumber-preview.$PreviewId"
} else {
$TagName = "v$VersionNumber"
}
$Message = "Release version $TagName"

# Display confirmation prompt
Write-Host "You are about to release:" -ForegroundColor Yellow
Write-Host "Tag: $TagName" -ForegroundColor Cyan
Write-Host "Message: $Message" -ForegroundColor Cyan
# Confirm with user
Write-Host "🚀 You are about to release:" -ForegroundColor Yellow
Write-Host " Tag: $TagName" -ForegroundColor Cyan
Write-Host " Message: $Message" -ForegroundColor Cyan
$response = Read-Host "Are you sure you want to proceed? (yes/no)"

if ($response -ne "yes") {
Write-Host "Release canceled by the user." -ForegroundColor Red
Write-Host "Release canceled by the user." -ForegroundColor Red
exit 0
}

# Execute the git commands
Write-Host "Creating tag $TagName with message: $Message"
# Git commands
Write-Host "🔖 Creating tag $TagName with message: $Message"
git tag -a $TagName -m $Message

Write-Host "Pushing tag $TagName to origin"
Write-Host "⬆️ Pushing tag $TagName to origin"
git push origin $TagName

Write-Host "Tag $TagName pushed successfully." -ForegroundColor Green
Write-Host "Tag $TagName pushed successfully." -ForegroundColor Green
Loading