Skip to content

Commit bdb414f

Browse files
committed
use assembly signing
1 parent 02d5f82 commit bdb414f

5 files changed

Lines changed: 24 additions & 3 deletions

File tree

.github/workflows/build-test-publish.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,21 @@ jobs:
2424
8.0.x
2525
9.0.x
2626
27+
- name: Decrypt signing key
28+
run: |
29+
openssl aes-256-cbc -d -pbkdf2 \
30+
-in key_private.snk.enc \
31+
-out key_private.snk \
32+
-pass pass:${{ secrets.STRONG_NAME_PASSWORD }}
33+
2734
- name: Restore dependencies
2835
run: dotnet restore
2936

30-
- name: Build
31-
run: dotnet build -c Release --no-restore
37+
- name: Build and sign (trusted release)
38+
run: dotnet build -c Release --no-restore \
39+
/p:SignAssembly=true \
40+
/p:PublicSign=false \
41+
/p:AssemblyOriginatorKeyFile=key_private.snk
3242

3343
- name: Run Tests
3444
run: dotnet test -c Release --no-restore --no-build -v normal
@@ -43,4 +53,7 @@ jobs:
4353
path: ~/nuget-packages
4454

4555
- name: Push NuGet Package(s)
46-
run: dotnet nuget push ~/nuget-packages/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
56+
run: dotnet nuget push ~/nuget-packages/*.nupkg \
57+
--source https://api.nuget.org/v3/index.json \
58+
--api-key ${{ secrets.NUGET_API_KEY }} \
59+
--skip-duplicate

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,3 +400,5 @@ FodyWeavers.xsd
400400
# JetBrains Rider
401401
*.sln.iml
402402

403+
# Ignore private snk
404+
key_private.snk

src/GenericReader/GenericReader.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
<Version>2.2.3</Version>
77
</PropertyGroup>
88

9+
<PropertyGroup>
10+
<SignAssembly>true</SignAssembly>
11+
<PublicSign>true</PublicSign>
12+
<AssemblyOriginatorKeyFile>..\key_public.snk</AssemblyOriginatorKeyFile>
13+
</PropertyGroup>
14+
915
<PropertyGroup>
1016
<GenerateDocumentationFile>false</GenerateDocumentationFile>
1117
<PackageIcon>icon.png</PackageIcon>

src/key_private.snk.enc

624 Bytes
Binary file not shown.

src/key_public.snk

160 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)