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