15
15
16
16
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17
17
jobs :
18
- # Creates Signs and Pushes a NuGet from a Nuspec file called template.nuspec located in the root of workspace"
18
+ # Creates from a Nuspec file called template.nuspec located in the root of workspace"
19
19
build :
20
20
# The type of runner that the job will run on
21
21
runs-on : ubuntu-latest
22
-
23
22
# Steps represent a sequence of tasks that will be executed as part of the job
24
23
steps :
25
24
- uses : actions/checkout@v3
26
- # - uses: nuget/setup-nuget@v1
27
- # with:
28
- # nuget-api-key: ${{ secrets.NuGetAPIKey }}
29
- # nuget-version: '6.x'
30
-
25
+
31
26
- name : Create NuGet Package
32
27
run : |
33
28
dotnet pack ./working
@@ -45,27 +40,47 @@ jobs:
45
40
run : echo "${{ steps.findcreatednuget.outputs.nugetPackageName }}"
46
41
shell : bash
47
42
43
+ - uses : actions/upload-artifact@v3
44
+ with :
45
+ name : NugetPackages
46
+ path : " ${{ steps.findcreatednuget.outputs.nugetPackageName }}"
47
+
48
+ # Signing cannot be done from linux environment (https://github.com/dotnet/runtime/issues/48794)
49
+ sign :
50
+ # The type of runner that the job will run on
51
+ runs-on : windows-latest
52
+ needs : build
53
+ steps :
54
+ - name : Download Unsigned NuGet
55
+ id : downloadUnsignedNuget
56
+ uses : actions/download-artifact@v3
57
+ with :
58
+ name : NugetPackages
59
+
60
+ - name : Find Nuget
61
+ id : findcreatednuget
62
+ run : |
63
+ echo nugetPackageName=$(find . -type f -name '*.nupkg') >> $GITHUB_OUTPUT
64
+ shell : bash
65
+
48
66
- name : Download Encrypted Signature File
49
67
id : downloadSignatureFile
50
68
env :
51
- CERTIFICATE_BASE64 : ${{ secrets.SKYLINEPFX3 }}
52
- run : |
53
- echo "$CERTIFICATE_BASE64" | base64 --decode > Skyline.pfx
54
-
55
- # - name: Install certutil
56
- # run: sudo apt-get install libnss3-tools
57
-
58
- # - name: Decrypt Signature File
59
- # id: decryptSignatureFile
60
- # run: certutil -decode encodedSignatureFile Skyline.pfx
61
- # shell: bash
62
-
69
+ CERTIFICATE_BASE64 : ${{ secrets.SKYLINEPFX }}
70
+ run : ' echo "$CERTIFICATE_BASE64" > encodedSignatureFile'
71
+ shell : bash
72
+
73
+ - name : Decrypt Signature File
74
+ id : decryptSignatureFile
75
+ run : certutil -decode encodedSignatureFile Skyline.pfx
76
+ shell : bash
77
+
63
78
- name : Sign NuGet Package
64
79
run : |
65
80
#nuget sign "${{ steps.findcreatednuget.outputs.nugetPackageName }}" -NonInteractive -CertificatePath "Skyline.pfx" -Timestamper "http://timestamp.comodoca.com/rfc3161" -CertificatePassword ${{ secrets.SKYLINEPFXPASSWORD }}
66
81
dotnet nuget sign "${{ steps.findcreatednuget.outputs.nugetPackageName }}" --certificate-path "Skyline.pfx" --timestamper "http://timestamp.comodoca.com/rfc3161" --certificate-password ${{ secrets.SKYLINEPFXPASSWORD }}
67
82
shell : bash
68
-
83
+
69
84
- uses : actions/upload-artifact@v3
70
85
with :
71
86
name : NugetPackages
0 commit comments