Skip to content

Commit 928698f

Browse files
committed
Enable deterministic builds for reproducible NuGet packages
Add deterministic build properties to Scrutor.csproj: - Deterministic=true: Ensures compiler generates byte-for-byte identical outputs for the same inputs - ContinuousIntegrationBuild=true (when CI=true): Normalizes file paths and timestamps in PDB files for reproducible builds Add CI=true to GitHub Actions workflow to explicitly enable ContinuousIntegrationBuild in CI environments. These settings ensure that building the same source code multiple times will produce identical NuGet packages, which is important for: - Security (verifying package contents match source) - Build reproducibility - Package verification and attestation
1 parent 5e63979 commit 928698f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ jobs:
88
if: "!contains(github.event.head_commit.message, '[skip ci]')"
99

1010
env:
11+
CI: true
1112
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
1213
DOTNET_CLI_TELEMETRY_OPTOUT: 1
1314
DOTNET_NOLOGO: true

src/Scrutor/Scrutor.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2626
<!-- Only increase this value in case of incompatible API changes. -->
2727
<AssemblyVersion>6.0.0.0</AssemblyVersion>
28+
<!-- Deterministic builds -->
29+
<Deterministic>true</Deterministic>
30+
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild>
2831
</PropertyGroup>
2932

3033
<ItemGroup>

0 commit comments

Comments
 (0)