1
- # This is a basic workflow to help you get started with Actions
2
-
3
1
name : CI
4
2
5
- # Controls when the workflow will run
6
3
on :
7
- # Triggers the workflow on push or pull request events but only for the master branch
8
4
push :
9
5
branches :
10
6
- main
11
- - master
12
7
tags :
13
8
- ' [0-9]+.[0-9]+.[0-9]+'
14
9
- ' [0-9]+.[0-9]+.[0-9]+-[0-9a-zA-Z]+'
15
10
16
- # Allows you to run this workflow manually from the Actions tab
17
11
workflow_dispatch :
18
12
19
- # A workflow run is made up of one or more jobs that can run sequentially or in parallel
20
13
jobs :
21
- # Creates from a Nuspec file called template.nuspec located in the root of workspace"
22
14
build :
23
- # The type of runner that the job will run on
24
15
runs-on : ubuntu-latest
25
- # Steps represent a sequence of tasks that will be executed as part of the job
26
16
steps :
27
17
- uses : actions/checkout@v4
28
18
29
19
- name : Create NuGet Package
30
- run : |
31
- dotnet pack ./working
20
+ run : dotnet pack ./working
32
21
33
22
- name : Find created nuget
34
23
id : findcreatednuget
35
- run : |
36
- #cd ./working/bin/Debug/
37
- #echo nugetPackageName=$(dir *.nupkg) >> $GITHUB_OUTPUT
38
- echo nugetPackageName=$(find . -type f -name '*.nupkg') >> $GITHUB_OUTPUT
39
- shell : bash
40
-
41
- - name : Echo Found Package
42
- id : echoFoundPackage
43
- run : echo "${{ steps.findcreatednuget.outputs.nugetPackageName }}"
24
+ run : echo nugetPackageName=$(find . -type f -name '*.nupkg') >> $GITHUB_OUTPUT
44
25
shell : bash
45
26
46
27
- uses : actions/upload-artifact@v4
47
28
with :
48
29
name : NugetPackages
49
30
path : " ${{ steps.findcreatednuget.outputs.nugetPackageName }}"
50
31
51
- # Signing cannot be done from linux environment (https://github.com/dotnet/runtime/issues/48794)
52
32
sign :
53
- # The type of runner that the job will run on
54
33
runs-on : windows-latest
55
34
needs : build
56
35
steps :
36
+ - name : Install Sign CLI tool
37
+ run : dotnet tool install sign -g --prerelease
38
+
57
39
- name : Download Unsigned NuGet
58
40
id : downloadUnsignedNuget
59
41
uses : actions/download-artifact@v4
@@ -62,32 +44,28 @@ jobs:
62
44
63
45
- name : Find Nuget
64
46
id : findcreatednuget
65
- run : |
66
- echo nugetPackageName=$(find . -type f -name '*.nupkg') >> $GITHUB_OUTPUT
67
- shell : bash
68
-
69
- - name : Download Encrypted Signature File
70
- id : downloadSignatureFile
71
- env :
72
- CERTIFICATE_BASE64 : ${{ secrets.SKYLINEPFX }}
73
- run : ' echo "$CERTIFICATE_BASE64" > encodedSignatureFile'
47
+ run : echo nugetPackageName=$(find . -type f -name '*.nupkg') >> $GITHUB_OUTPUT
74
48
shell : bash
75
49
76
- - name : Decrypt Signature File
77
- id : decryptSignatureFile
78
- run : certutil -decode encodedSignatureFile Skyline.pfx
79
- shell : bash
80
-
81
50
- name : Sign NuGet Package
82
- run : |
83
- #nuget sign "${{ steps.findcreatednuget.outputs.nugetPackageName }}" -NonInteractive -CertificatePath "Skyline.pfx" -Timestamper "http://timestamp.comodoca.com/rfc3161" -CertificatePassword ${{ secrets.SKYLINEPFXPASSWORD }}
84
- dotnet nuget sign "${{ steps.findcreatednuget.outputs.nugetPackageName }}" --certificate-path "Skyline.pfx" --timestamper "http://timestamp.comodoca.com/rfc3161" --certificate-password ${{ secrets.SKYLINEPFXPASSWORD }}
85
- shell : bash
51
+ shell : pwsh
52
+ run : >
53
+ sign code azure-key-vault
54
+ ${{ steps.findcreatednuget.outputs.nugetPackageName }}
55
+ --publisher-name "Skyline Communications"
56
+ --description "Skyline Signing"
57
+ --description-url "https://www.skyline.be/"
58
+ --azure-key-vault-tenant-id "5f175691-8d1c-4932-b7c8-ce990839ac40"
59
+ --azure-key-vault-client-id "a7ff072c-5bc8-4fa0-9e0c-bb9e40d59b0b"
60
+ --azure-key-vault-client-secret "${{ secrets.PFXPASSWORD }}"
61
+ --azure-key-vault-certificate "Skyline-CodeSigning"
62
+ --azure-key-vault-url "https://kv-slc-codesigning.vault.azure.net/"
86
63
87
64
- uses : actions/upload-artifact@v4
88
65
with :
89
66
name : SignedNugetPackages
90
67
path : " ${{ steps.findcreatednuget.outputs.nugetPackageName }}"
68
+
91
69
push :
92
70
if : github.ref_type == 'tag'
93
71
name : push
@@ -101,12 +79,10 @@ jobs:
101
79
name : SignedNugetPackages
102
80
103
81
- name : Find Nuget
104
- id : findcreatednuget
105
- run : |
106
- echo nugetPackageName=$(find . -type f -name '*.nupkg') >> $GITHUB_OUTPUT
82
+ id : findcreatednuget
83
+ run : echo nugetPackageName=$(find . -type f -name '*.nupkg') >> $GITHUB_OUTPUT
107
84
shell : bash
108
85
109
86
- name : Push to NuGet.org
110
- run : |
111
- dotnet nuget push "${{ steps.findcreatednuget.outputs.nugetPackageName }}" --api-key ${{ secrets.NUGETAPIKEY }} --source https://api.nuget.org/v3/index.json
87
+ run : dotnet nuget push "${{ steps.findcreatednuget.outputs.nugetPackageName }}" --api-key ${{ secrets.NUGETAPIKEY }} --source https://api.nuget.org/v3/index.json
112
88
shell : bash
0 commit comments