Skip to content

Commit d1cbb5d

Browse files
authored
Use NUGET_SIGNING_KEY for NuGet publish signing (#733)
1 parent 4bb0b73 commit d1cbb5d

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

.github/workflows/publish-nuget.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020

2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@v5
2424
with:
2525
fetch-depth: 0
2626

2727
- name: Setup .NET
28-
uses: actions/setup-dotnet@v4
28+
uses: actions/setup-dotnet@v5
2929
with:
3030
dotnet-version: |
3131
6.0.x
@@ -37,12 +37,17 @@ jobs:
3737
run: dotnet restore src/RulesEngine/RulesEngine.csproj
3838

3939
- name: Build signed
40-
run: >
41-
dotnet build src/RulesEngine/RulesEngine.csproj
42-
--configuration Release
43-
-p:ContinuousIntegrationBuild=true
44-
-p:DelaySign=false
45-
-p:AssemblyOriginatorKeyFile=../../signing/RulesEngine-publicKey.snk
40+
shell: pwsh
41+
env:
42+
NUGET_SIGNING_KEY: ${{ secrets.NUGET_SIGNING_KEY }}
43+
run: |
44+
if ([string]::IsNullOrWhiteSpace($env:NUGET_SIGNING_KEY)) {
45+
throw "Missing NUGET_SIGNING_KEY secret. The checked-in signing/RulesEngine-publicKey.snk does not include a private key."
46+
}
47+
48+
./deployment/build-signed.ps1 `
49+
-csprojFilePath src/RulesEngine/RulesEngine.csproj `
50+
-signingKey $env:NUGET_SIGNING_KEY
4651
4752
- name: Pack
4853
run: >

0 commit comments

Comments
 (0)