diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..a6eb98e --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @chrismckee \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index aec207e..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -updates: -- package-ecosystem: nuget - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 0000000..d9e2d26 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,120 @@ +name: CI Build + +on: + workflow_dispatch: + push: + branches: + - 'main' + paths-ignore: + - 'docs/**' + - '.github/**' + pull_request: + branches: + - 'main' + +permissions: + contents: read + issues: read + pull-requests: write + checks: write + +env: + DOTNET_NOLOGO: true + DOTNET_GENERATE_ASPNET_CERTIFICATE: false + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + +jobs: + build: + name: Build and Test + runs-on: ubuntu-24.04 + steps: + - name: 'Harden Runner' + uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 + with: + egress-policy: audit + + - name: 'Checkout' + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 # avoid shallow clone so nbgv can do its work. + + - name: 'Setup .NET SDK' + uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0 + with: + dotnet-version: 10.0.x + + - name: 'Restore external dependencies' + run: dotnet restore + + - name: 'Build' + id: build + run: dotnet build --configuration Debug --no-restore + + - name: Upload Build Artifacts + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: build-artifacts + path: | + src/**/BCrypt.*.nupkg + src/**/BCrypt.*.dll + src/**/BCrypt.*.deps.json + src/**/BCrypt.*.xml + retention-days: 5 + + - name: 'Test' + id: test + run: dotnet test --restore --collect:"XPlat Code Coverage" --logger junit --configuration Debug + + - name: 'Create test summary' + uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4 + with: + paths: tests/UnitTests/**/TestResults.xml + show: "fail, skip" + if: always() + + - name: 'Generate Coverage Reports' + uses: danielpalme/ReportGenerator-GitHub-Action@c4c5175a441c6603ec614f5084386dabe0e2295b # v5.4.12 + with: + reports: "tests/**/coverage.cobertura.xml" + targetdir: "${{ github.workspace }}" + reporttypes: "Cobertura" + verbosity: "Info" + title: "Code Coverage" + tag: "${{ github.run_number }}_${{ github.run_id }}" + toolpath: "reportgeneratortool" + license: ${{ secrets.REPORT_GENERATOR_LICENSE }} + + - name: Publish Code Coverage Report + uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0 + with: + filename: "Cobertura.xml" + badge: true + fail_below_min: false # just informative for now + format: markdown + hide_branch_rate: false + hide_complexity: false + indicators: true + output: both + thresholds: "10 30" + + - name: Upload Code Coverage Results + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: coverage-results + path: | + ${{ github.workspace }}/Cobertura.xml + ${{ github.workspace }}/code-coverage-results.md + retention-days: 5 + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@afb2984f4d89672b2f9d9c13ae23d53779671984 # v2.19.0 + if: always() + with: + files: "tests/**/TestResults.xml" + + - name: Upload Test Artifacts + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: test-results + path: "tests/**/TestResults.xml" + retention-days: 5 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index c994c19..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: 'Code scanning - action' - -on: - workflow_dispatch: - push: - paths: - - '*' - - '!/readme.md' - - '!/SECURITY.md' - - '!/licence.txt' - - '!/Benchmark/*' - - '!/IntegrationTest/*' - - '!/dists/*' - - '!/assets/*' - pull_request: - paths: - - '*' - - '!/readme.md' - - '!/SECURITY.md' - - '!/licence.txt' - - '!/Benchmark/*' - - '!/IntegrationTest/*' - - '!/dists/*' - - '!/assets/*' - schedule: - - cron: '0 6 * * 4' - -jobs: - analyse: - runs-on: ubuntu-latest - defaults: - run: - working-directory: src/BCrypt.Net - permissions: - actions: read - contents: read - security-events: write - env: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Setup .NET - uses: actions/setup-dotnet@v2 - with: - dotnet-version: '6.0.x' - - name: Setup CodeQL - uses: github/codeql-action/init@v2 - with: - languages: csharp - - name: Build solution - run: dotnet build /t:rebuild /p:UseSharedCompilation=false -c Release BCrypt.Net.csproj -f net6.0 - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml deleted file mode 100644 index 76cd8ba..0000000 --- a/.github/workflows/dotnet.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: .NET - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Setup .NET - uses: actions/setup-dotnet@v2 - with: - dotnet-version: 6.0.x - - name: Restore dependencies - run: dotnet restore src/BCrypt.Net.UnitTests/BCrypt.Net.UnitTests.csproj - - name: Build - run: dotnet build --no-restore src/BCrypt.Net.UnitTests/BCrypt.Net.UnitTests.csproj - - name: Test - run: dotnet test --no-build --verbosity normal src/BCrypt.Net.UnitTests/BCrypt.Net.UnitTests.csproj diff --git a/dists/BCrypt.Net-Next.4.2.0.nupkg b/dists/BCrypt.Net-Next.4.2.0.nupkg new file mode 100644 index 0000000..0c18cc1 Binary files /dev/null and b/dists/BCrypt.Net-Next.4.2.0.nupkg differ diff --git a/dists/BCrypt.Net-Next.StrongName.4.2.0.nupkg b/dists/BCrypt.Net-Next.StrongName.4.2.0.nupkg new file mode 100644 index 0000000..a8133a0 Binary files /dev/null and b/dists/BCrypt.Net-Next.StrongName.4.2.0.nupkg differ diff --git a/src/BCrypt.Net.MainPackage/BCrypt.Net.Package.csproj b/src/BCrypt.Net.MainPackage/BCrypt.Net.Package.csproj index e346131..be017f2 100644 --- a/src/BCrypt.Net.MainPackage/BCrypt.Net.Package.csproj +++ b/src/BCrypt.Net.MainPackage/BCrypt.Net.Package.csproj @@ -1,12 +1,12 @@  - BCrypt.Net-Next - BCrypt.Net-Next + BCrypt-Net-Next + BCrypt-Net-Next BCrypt.Net-Next BCrypt .Net - netstandard2.0;netstandard2.1;net20;net35;net462;net472;net48;net10.0 + netstandard2.0;netstandard2.1;net462;net472;net48;net10.0 Library true false @@ -24,7 +24,7 @@ true ../bcrypt.pfx - 4.1.0 + 4.2.0 bcrypt;BCrypt.Net;cryptography;hashing;password;security,hash;crypto;blowfish;gdpr Debug;Release @@ -37,32 +37,21 @@ - - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client - - - - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client - $(DefineConstants);NET2_1 - - - - - + - + - + $(DefineConstants);HAS_SPAN diff --git a/src/BCrypt.Net.StrongName/BCrypt.Net.StrongName.csproj b/src/BCrypt.Net.StrongName/BCrypt.Net.StrongName.csproj index 941c14f..e251ef9 100644 --- a/src/BCrypt.Net.StrongName/BCrypt.Net.StrongName.csproj +++ b/src/BCrypt.Net.StrongName/BCrypt.Net.StrongName.csproj @@ -1,12 +1,12 @@  - BCrypt.Net-Next.StrongName - BCrypt.Net-Next.StrongName + BCrypt.Net-Next-StrongName + BCrypt.Net-Next-StrongName BCrypt.Net-Next.StrongName BCrypt .Net (Strong Named) - netstandard2.0;netstandard2.1;net20;net35;net462;net472;net48;net10.0 + netstandard2.0;netstandard2.1;net462;net472;net48;net10.0 Library true false @@ -24,7 +24,7 @@ true ../bcrypt.pfx - 4.1.0 + 4.2.0 bcrypt;BCrypt.Net;cryptography;hashing;password;security,hash;crypto;blowfish;gdpr Debug;Release @@ -37,32 +37,21 @@ - - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client - - - - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client - $(DefineConstants);NET2_1 - - - - - + - + - + $(DefineConstants);HAS_SPAN diff --git a/src/BCrypt.Net.UnitTests/BCrypt.Net.UnitTests.csproj b/src/BCrypt.Net.UnitTests/BCrypt.Net.UnitTests.csproj index 7cdc21a..a57f62c 100644 --- a/src/BCrypt.Net.UnitTests/BCrypt.Net.UnitTests.csproj +++ b/src/BCrypt.Net.UnitTests/BCrypt.Net.UnitTests.csproj @@ -13,7 +13,7 @@ - + all diff --git a/src/BCrypt.Net/BCrypt.Net.csproj b/src/BCrypt.Net/BCrypt.Net.csproj index c4fb231..2871bf6 100644 --- a/src/BCrypt.Net/BCrypt.Net.csproj +++ b/src/BCrypt.Net/BCrypt.Net.csproj @@ -6,7 +6,7 @@ BCrypt.Net-Next BCrypt .Net - netstandard2.0;netstandard2.1;net20;net35;net462;net472;net48;net10.0 + netstandard2.0;netstandard2.1;net462;net472;net48;net10.0 Library false false @@ -28,23 +28,11 @@ false - - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client - - - - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client - - $(DefineConstants);NET2_1 - - - - - + diff --git a/src/Benchmark/Benchmark.csproj b/src/Benchmark/Benchmark.csproj index 5b94166..e98636b 100644 --- a/src/Benchmark/Benchmark.csproj +++ b/src/Benchmark/Benchmark.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1;net48;net472;net6.0 + net48;net472;net10.0 Benchmark @@ -24,7 +24,7 @@ - + $(DefineConstants);NET2_1 diff --git a/src/global.json b/src/global.json new file mode 100644 index 0000000..a11f48e --- /dev/null +++ b/src/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "10.0.0", + "rollForward": "latestMajor", + "allowPrerelease": true + } +} \ No newline at end of file