Skip to content

Commit 07e579d

Browse files
authored
Use published sign.exe CLI and 3rd part certificate extractor tools (#1647)
Use a 3rd party tool to extract the NuGet signing certificate for upload rather than relying on an option added to the sign.exe tool in a private fork. At the same time let's use the `dotnet tool install` command to acquire the code signing tool, rather than rely on our Azure blob store. Also let's drop the `-d` and `-u` options from the sign.exe CLI; they are no longer required ([source](dotnet/sign#734 (comment))).
2 parents 61000ad + ddba796 commit 07e579d

File tree

1 file changed

+19
-25
lines changed

1 file changed

+19
-25
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -349,24 +349,16 @@ jobs:
349349
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
350350
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
351351

352-
- name: Download/extract Sign CLI tool
353-
env:
354-
AST: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
355-
ASC: ${{ secrets.AZURE_STORAGE_CONTAINER }}
356-
SCT: 'Sign.Cli-alpha.zip'
352+
- name: Install sign CLI tool
357353
run: |
358-
az storage blob download --file sign-cli.zip --auth-mode login `
359-
--account-name $env:AST --container-name $env:ASC --name $env:SCT
360-
Expand-Archive -Path sign-cli.zip -DestinationPath .\sign-cli
354+
dotnet tool install -g --version 0.9.1-beta.24325.5
361355
362356
- name: Sign payload
363357
run: |
364-
./sign-cli/sign.exe code trusted-signing payload/* `
358+
sign.exe code trusted-signing payload/* `
365359
-tse https://wus2.codesigning.azure.net/ `
366360
-tsa git-fundamentals-signing `
367-
-tscp git-fundamentals-windows-signing `
368-
-d "Git Fundamentals Windows Signing Certificate" `
369-
-u "https://github.com/git-ecosystem/git-credential-manager"
361+
-tscp git-fundamentals-windows-signing
370362
371363
- name: Lay out signed payload, images, and symbols
372364
shell: bash
@@ -433,28 +425,30 @@ jobs:
433425
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
434426
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
435427

436-
- name: Download/extract Sign CLI tool
437-
env:
438-
AST: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
439-
ASC: ${{ secrets.AZURE_STORAGE_CONTAINER }}
440-
SCT: 'Sign.Cli-alpha.zip'
428+
- name: Install sign CLI tool
441429
run: |
442-
az storage blob download --file sign-cli.zip --auth-mode login `
443-
--account-name $env:AST --container-name $env:ASC --name $env:SCT
444-
Expand-Archive -Path sign-cli.zip -DestinationPath .\sign-cli
430+
dotnet tool install -g --version 0.9.1-beta.24325.5
445431
446432
- name: Sign package
447433
run: |
448-
./sign-cli/sign.exe code trusted-signing nupkg/* `
434+
sign.exe code trusted-signing nupkg/* `
449435
-tse https://wus2.codesigning.azure.net/ `
450436
-tsa git-fundamentals-signing `
451-
-tscp git-fundamentals-windows-signing `
452-
-d "Git Fundamentals Windows Signing Certificate" `
453-
-u "https://github.com/git-ecosystem/git-credential-manager" `
454-
-co nuget-signing-certificate.cer
437+
-tscp git-fundamentals-windows-signing
455438
456439
mv nupkg/* .
457440
441+
# Remove this once NuGet supports the subscriber identity validation EKU:
442+
# https://github.com/NuGet/NuGetGallery/issues/10027
443+
- name: Extract signing certificate from package
444+
shell: pwsh
445+
run: |
446+
dotnet tool install --global Knapcode.CertificateExtractor
447+
$nupkg = gci *.nupkg
448+
nuget-cert-extractor --file $nupkg --output certs --code-signing --author --leaf
449+
$cert = gci certs\*.cer
450+
mv $cert .\nuget-signing.cer
451+
458452
- name: Publish signed package and certificate
459453
uses: actions/upload-artifact@v4
460454
with:

0 commit comments

Comments
 (0)