Skip to content

Commit 272d0b5

Browse files
committed
2 parents 95ae128 + e7c2dff commit 272d0b5

File tree

1 file changed

+35
-20
lines changed

1 file changed

+35
-20
lines changed

.github/workflows/CreateSignNuGet.yml

+35-20
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,14 @@ on:
1515

1616
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1717
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"
1919
build:
2020
# The type of runner that the job will run on
2121
runs-on: ubuntu-latest
22-
2322
# Steps represent a sequence of tasks that will be executed as part of the job
2423
steps:
2524
- 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+
3126
- name: Create NuGet Package
3227
run: |
3328
dotnet pack ./working
@@ -45,27 +40,47 @@ jobs:
4540
run: echo "${{ steps.findcreatednuget.outputs.nugetPackageName }}"
4641
shell: bash
4742

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+
4866
- name: Download Encrypted Signature File
4967
id: downloadSignatureFile
5068
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+
6378
- name: Sign NuGet Package
6479
run: |
6580
#nuget sign "${{ steps.findcreatednuget.outputs.nugetPackageName }}" -NonInteractive -CertificatePath "Skyline.pfx" -Timestamper "http://timestamp.comodoca.com/rfc3161" -CertificatePassword ${{ secrets.SKYLINEPFXPASSWORD }}
6681
dotnet nuget sign "${{ steps.findcreatednuget.outputs.nugetPackageName }}" --certificate-path "Skyline.pfx" --timestamper "http://timestamp.comodoca.com/rfc3161" --certificate-password ${{ secrets.SKYLINEPFXPASSWORD }}
6782
shell: bash
68-
83+
6984
- uses: actions/upload-artifact@v3
7085
with:
7186
name: NugetPackages

0 commit comments

Comments
 (0)