From d327426e9a6ddc8946b1364ac6d5764cf9761d0c Mon Sep 17 00:00:00 2001 From: napoly Date: Tue, 10 Jun 2025 11:54:08 +0200 Subject: [PATCH] Add deterministic / reproducible build with validation --- .github/workflows/dotnet.yml | 21 ++++++++++++++----- .gitignore | 1 + .../Monero/BTCPayServer.Plugins.Monero.csproj | 11 ++++++++-- submodules/btcpayserver | 2 +- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index adeb3d4..86dac7c 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -33,11 +33,16 @@ jobs: - name: Build projects run: dotnet build -c Release --no-restore - - name: Install JetBrains dotCover CLI - run: dotnet tool install --global JetBrains.dotCover.CommandLineTools - + - name: Deterministic build check + run: | + dotnet tool install --global dotnet-validate --version 0.0.1-preview.537 + dotnet pack Plugins/Monero/BTCPayServer.Plugins.Monero.csproj -c Release /p:PackageVersion=1 --no-build -o nuget-packages + dotnet validate package local nuget-packages/BTCPayServer.Plugins.Monero.1.0.0.nupkg + - name: Run unit tests - run: dotCover cover-dotnet --TargetArguments="test BTCPayServer.Plugins.UnitTests -c Release --no-build" --output=coverage/dotCover.UnitTests.output.dcvr --filters="-:Assembly=BTCPayServer.Plugins.UnitTests;-:Assembly=testhost;-:Assembly=BTCPayServer;-:Class=AspNetCoreGeneratedDocument.*" + run: | + dotnet tool install --global JetBrains.dotCover.CommandLineTools + dotCover cover-dotnet --TargetArguments="test BTCPayServer.Plugins.UnitTests -c Release --no-build" --output=coverage/dotCover.UnitTests.output.dcvr --filters="-:Assembly=BTCPayServer.Plugins.UnitTests;-:Assembly=testhost;-:Assembly=BTCPayServer;-:Class=AspNetCoreGeneratedDocument.*" - name: Run integration tests run: docker compose -f BTCPayServer.Plugins.IntegrationTests/docker-compose.yml run tests @@ -50,4 +55,10 @@ jobs: uses: actions/upload-artifact@v4.6.2 with: name: coverage-report - path: coverage/dotcover.xml \ No newline at end of file + path: coverage/dotcover.xml + + - name: Upload NuGet package + uses: actions/upload-artifact@v4.6.2 + with: + name: nuget-package-${{ github.sha }} + path: nuget-packages/BTCPayServer.Plugins.Monero.1.0.0.nupkg \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5b5ab00..b09e66e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ Plugins/packed .vs/ coverage +nuget-packages \ No newline at end of file diff --git a/Plugins/Monero/BTCPayServer.Plugins.Monero.csproj b/Plugins/Monero/BTCPayServer.Plugins.Monero.csproj index 9797977..56ea3b5 100644 --- a/Plugins/Monero/BTCPayServer.Plugins.Monero.csproj +++ b/Plugins/Monero/BTCPayServer.Plugins.Monero.csproj @@ -8,6 +8,7 @@ BTCPay Server: Monero support plugin This plugin extends BTCPay Server to enable users to receive payments via Monero. 1.0.2 + true @@ -15,6 +16,7 @@ true false true + $([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)')) @@ -25,9 +27,14 @@ runtime;native;build;buildTransitive;contentFiles - + + - + + + + +