Skip to content

Commit 525418b

Browse files
Refactor NuGet package signing in primary workflow
1 parent 4a89244 commit 525418b

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

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

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
shell: pwsh
5656

5757
- name: Sign all DLL files
58-
if: false # This step will never run
58+
continue-on-error: true
5959
shell: pwsh
6060
env:
6161
CERT_PASS: ${{ secrets.SIGNING_CERTIFICATE_PASSWORD }}
@@ -121,21 +121,17 @@ jobs:
121121
exit 1
122122
}
123123
124-
- name: Sign NuGet package
124+
- name: Sign NuGet package (using dotnet nuget sign)
125125
shell: pwsh
126126
env:
127-
CERT_PASS: ${{ secrets.SIGNING_CERTIFICATE_PASSWORD }}
128-
TIMESTAMP_URL: ${{ vars.SIGNING_CERTIFICATE_TIMESTAMP_URL }}
127+
SIGNING_CERTIFICATE_PASSWORD: ${{ secrets.SIGNING_CERTIFICATE_PASSWORD }}
128+
SIGNING_CERTIFICATE_TIMESTAMP_URL: ${{ vars.SIGNING_CERTIFICATE_TIMESTAMP_URL }}
129129
run: |
130-
$certPath = "${{ runner.temp }}\certificate.pfx"
130+
$certPath = Join-Path "${{ runner.temp }}" "certificate.pfx"
131131
$nupkgPath = "${{ github.workspace }}\nupkg\*.nupkg"
132132
133-
dotnet nuget sign $nupkgPath `
134-
--certificate-path $certPath `
135-
--certificate-password "$env:SIGNING_CERTIFICATE_PASSWORD" `
136-
--timestamper "$env:SIGNING_CERTIFICATE_TIMESTAMP_URL" `
137-
--overwrite
138-
133+
dotnet nuget sign $nupkgPath --certificate-path $certPath --certificate-password "$env:SIGNING_CERTIFICATE_PASSWORD" --timestamper "$env:SIGNING_CERTIFICATE_TIMESTAMP_URL" --overwrite
134+
139135
140136
- name: NuGet login (OIDC Trusted Publishing)
141137
uses: nuget/login@v1

0 commit comments

Comments
 (0)