Skip to content

Commit ff2b174

Browse files
authored
Merge pull request #39 from shinji-san/feature-DeterministicBuild
Feature - Deterministic build & SourceLink (GitHub) Resolves: #39
2 parents f01cc7b + 4974815 commit ff2b174

File tree

4 files changed

+18
-14
lines changed

4 files changed

+18
-14
lines changed

.github/workflows/dotnetall.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,19 @@ jobs:
3333
with:
3434
dotnet-version: 8.0.100
3535

36-
- name: .NET Core SxS
37-
run: |
38-
rsync -a ${DOTNET_ROOT/8.0.100/7.0.403/6.0.416}/* $DOTNET_ROOT/
39-
4036
- name: Restore
4137
run: dotnet restore LuhnDotNet.sln
4238

4339
- name: Build
44-
run: dotnet build --configuration Release LuhnDotNet.sln
40+
run: dotnet build --configuration Release --no-restore LuhnDotNet.sln
4541

4642
- name: Test
47-
run: dotnet test --configuration Release LuhnDotNet.sln
43+
run: dotnet test --no-restore --no-build --configuration Release LuhnDotNet.sln
4844

4945
- name: Prepare README.md for NuGet package
5046
run: |
5147
grep -n "## Install LuhnDotNet package" README.md | cut -d: -f 1| xargs -i tail -n +{} README.md > TMP.md && sed -i '1s/^/# Setup\r\n/' TMP.md && mv -f TMP.md README.md
5248
grep -n "# CLI building instructions" README.md | cut -d: -f 1| xargs -i head -n {} README.md | head -n -1 > TMP.md && mv -f TMP.md README.md
5349
5450
- name: Create Package
55-
run: dotnet pack --configuration Release LuhnDotNet.sln
51+
run: dotnet pack --no-restore --no-build --configuration Release LuhnDotNet.sln

.github/workflows/publishing.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ jobs:
3131
with:
3232
dotnet-version: 8.0.100
3333

34-
- name: .NET Core SxS
35-
run: |
36-
rsync -a ${DOTNET_ROOT/8.0.100/7.0.403/6.0.416}/* $DOTNET_ROOT/
37-
3834
- name: Decrypt large secret
3935
run: ./.github/secrets/decrypt_publisher_snk.sh
4036
env:
@@ -45,10 +41,10 @@ jobs:
4541
run: dotnet restore LuhnDotNet.sln
4642

4743
- name: Build
48-
run: dotnet build --configuration Release LuhnDotNet.sln
44+
run: dotnet build --no-restore --configuration Release LuhnDotNet.sln
4945

5046
- name: Test
51-
run: dotnet test --configuration Release LuhnDotNet.sln
47+
run: dotnet test --no-restore --no-build --configuration Release LuhnDotNet.sln
5248

5349
- name: Remove obsolete NuGet packages
5450
run: rm -f src/bin/Release/LuhnDotNet*.nupk
@@ -59,7 +55,7 @@ jobs:
5955
grep -n "# CLI building instructions" README.md | cut -d: -f 1| xargs -i head -n {} README.md | head -n -1 > TMP.md && mv -f TMP.md README.md
6056
6157
- name: Create package
62-
run: dotnet pack --configuration Release LuhnDotNet.sln
58+
run: dotnet pack --no-restore --no-build --configuration Release LuhnDotNet.sln
6359

6460
- name: Publish package
6561
run: dotnet nuget push $(find src/bin/Release -type f -name 'LuhnDotNet*.nupkg' -print 2> /dev/null) -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [Unreleased]
88
### Added
99
- Added .NET 8 support
10+
- Added support for SourceLink (GitHub)
11+
- Enable deterministic builds
1012

1113
### Changed
1214
- Changed parameter type of `Luhn.IsValid`, `Luhn.ComputeLuhnNumber` and `Luhn.ComputeCheckDigit` methods from `string` to `ReadOnlySpan<char>`.

src/LuhnDotNet.csproj

+10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@
2020
<Authors>Sebastian Walther</Authors>
2121
<Company>Private Person</Company>
2222
<GenerateDocumentationFile>true</GenerateDocumentationFile>
23+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
24+
<IncludeSymbols>true</IncludeSymbols>
25+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
26+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
27+
<Deterministic>true</Deterministic>
28+
</PropertyGroup>
29+
30+
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
31+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
2332
</PropertyGroup>
2433

2534
<ItemGroup>
@@ -31,6 +40,7 @@
3140
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3241
<PrivateAssets>all</PrivateAssets>
3342
</PackageReference>
43+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
3444
</ItemGroup>
3545

3646
</Project>

0 commit comments

Comments
 (0)