-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
57 lines (53 loc) · 1.71 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: trusted-sign-nuget
author: Jozef Izso
description: 'Sign NuGet packages with Azure Trusted Signing'
branding:
icon: 'shield'
color: 'yellow'
inputs:
nupkg-path:
required: true
type: string
default: '**/*.nupkg'
trusted-signing-file:
required: true
type: string
default: '.github/trusted-signing.json'
working-directory:
required: true
type: string
publisher-name:
required: true
type: string
description:
required: true
type: string
description-url:
required: true
type: string
runs:
using: 'composite'
steps:
- name: Setup dotnet sign
shell: pwsh
run: |
dotnet tool install --tool-path . --prerelease sign
dotnet tool install --global Knapcode.CertificateExtractor --version 0.1.1
- name: Sign packages
shell: pwsh
run: |
$trustedsigning = Get-Content '${{ inputs.trusted-signing-file }}' | ConvertFrom-Json
./sign code trusted-signing `
'${{ inputs.nupkg-path }}' `
--base-directory '${{ inputs.working-directory }}' `
--publisher-name '${{ inputs.publisher-name }}' `
--description '${{ inputs.description }}' `
--description-url '${{ inputs.description-url }}' `
--trusted-signing-endpoint $trustedsigning.Endpoint `
--trusted-signing-account $trustedsigning.CodeSigningAccountName `
--trusted-signing-certificate-profile $trustedsigning.CertificateProfileName
- name: Extract certificate
shell: pwsh
run: |
$nupkg = Get-ChildItem -Path '${{ inputs.working-directory }}' -Filter '*.nupkg' | Select-Object -First 1
nuget-cert-extractor --file $nupkg --output certificates --code-signing --author --leaf