diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3c81d22 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + +jobs: + build-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 8.0.x + 9.0.x + 10.0.x + + - name: Restore + run: dotnet restore Ed25519.sln --nologo + + - name: Build + run: dotnet build Ed25519.sln --configuration Release --no-restore --nologo + + - name: Test + run: dotnet test tests/Ed25519.Tests.csproj --configuration Release --no-build --nologo diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml new file mode 100644 index 0000000..228fbd7 --- /dev/null +++ b/.github/workflows/publish-nuget.yml @@ -0,0 +1,41 @@ +name: Publish NuGet + +on: + push: + tags: + - "v*.*.*" + workflow_dispatch: + +permissions: + contents: read + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 8.0.x + 9.0.x + 10.0.x + + - name: Restore + run: dotnet restore Ed25519.sln --nologo + + - name: Build + run: dotnet build Ed25519.sln --configuration Release --no-restore --nologo + + - name: Test + run: dotnet test tests/Ed25519.Tests.csproj --configuration Release --no-build --nologo + + - name: Pack + run: dotnet pack src/Ed25519.csproj --configuration Release --no-build --nologo -o artifacts + + - name: Push to NuGet + run: dotnet nuget push artifacts/*.nupkg --api-key "${{ secrets.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate diff --git a/README.md b/README.md index d1b79b2..9bbbee7 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,14 @@ A pure C# implementation of the Ed25519 digital signature algorithm, ported from ## Installation +Install from NuGet: + ```bash -dotnet add package Ed25519 +dotnet add package Dexcompiler.Ed25519 ``` +> Note: This package ID is the canonical package name for this repository. The similarly named `Ed25519` package on NuGet is a different project. + ## Usage ### Generate a Keypair @@ -157,6 +161,14 @@ The implementation uses constant-time conditional moves (`CMov`, `CSwap`) to pre - **Base point B**: The standard Ed25519 generator - **Group order L**: `2²⁵² + 27742317777372353535851937790883648493` +## Maintainer Release Workflow + +1. Set `NUGET_API_KEY` in repository secrets. +2. Update `Version` in `src/Ed25519.csproj` for the intended release. +3. Push a tag in `vX.Y.Z` format (for example, `v1.0.5`). +4. GitHub Actions will build, test, pack, and publish `Dexcompiler.Ed25519` with `--skip-duplicate`. +5. Verify package availability on nuget.org and test `dotnet add package Dexcompiler.Ed25519` in a clean project. + ## License MIT License diff --git a/src/Ed25519.csproj b/src/Ed25519.csproj index 3eeee88..db81569 100644 --- a/src/Ed25519.csproj +++ b/src/Ed25519.csproj @@ -11,7 +11,7 @@ Library - Ed25519 + Dexcompiler.Ed25519 1.0.4 Dexter Ajoku Pure C# implementation of Ed25519 digital signatures. RFC 8032 compliant, ported from ref10 reference implementation. Includes PKCS#8/SPKI/PEM key import/export.