44 workflow_call :
55 inputs :
66 artifact-glob :
7- description : Glob pattern to match artifacts to sign (e.g. dist/**/*.{jar,deb,rpm})
7+ description : Glob pattern to match artifacts to sign (e.g. dist/**/*.{jar,deb,rpm,nupkg })
88 required : true
99 type : string
1010 output-dir :
1717 required : false
1818 type : number
1919 default : 7
20+ enable-nuget-signing :
21+ description : Enable SSL.com signing for NuGet packages
22+ required : false
23+ type : boolean
24+ default : false
25+ nuget-environment :
26+ description : SSL.com environment name for NuGet signing
27+ required : false
28+ type : string
29+ default : PROD
30+ jvm-max-memory :
31+ description : Maximum JVM memory for NuGet signing process
32+ required : false
33+ type : string
34+ default : 1024M
2035 secrets :
2136 gpg-private-key :
2237 required : true
2338 gpg-public-key :
2439 required : true
2540 gpg-key-pass :
2641 required : true
42+ es-username :
43+ description : SSL.com username for NuGet signing
44+ required : false
45+ es-password :
46+ description : SSL.com password for NuGet signing
47+ required : false
48+ credential-id :
49+ description : SSL.com credential ID for NuGet signing
50+ required : false
51+ es-totp-secret :
52+ description : SSL.com TOTP secret for NuGet signing
53+ required : false
54+
2755permissions :
2856 contents : read
2957 packages : read
58+
3059jobs :
3160 sign :
3261 runs-on : ubuntu-22.04
@@ -44,10 +73,54 @@ jobs:
4473 run : |
4574 sudo apt-get update && sudo apt-get install dpkg-sig dpkg-dev -y
4675
47- - name : Sign Artifacts
76+ - name : Sign Artifacts with GPG
4877 run : |
4978 chmod +x ${{ github.workspace }}/.github/workflows/sign-artifacts/entrypoint.sh
5079 ${{ github.workspace }}/.github/workflows/sign-artifacts/entrypoint.sh "${{ inputs.artifact-glob }}" "${{ inputs.output-dir }}"
80+
81+ - name : Check for NuGet packages and sign if enabled
82+ if : inputs.enable-nuget-signing
83+ run : |
84+ echo "Checking for NuGet packages..."
85+ NUGET_PACKAGES=$(find "${{ inputs.output-dir }}" -name "*.nupkg" -type f)
86+ if [ -n "$NUGET_PACKAGES" ]; then
87+ echo "Found NuGet packages, signing with SSL.com..."
88+ echo "$NUGET_PACKAGES" | while read -r file; do
89+ echo "Signing: $file"
90+ done
91+ else
92+ echo "No NuGet packages found"
93+ fi
94+
95+ - name : Sign NuGet Packages with SSL.com
96+ if : inputs.enable-nuget-signing
97+ uses : sslcom/esigner-codesign@a272724cb13abe0abc579c6c40f7899969b6942b
98+ with :
99+ command : sign
100+ username : ${{secrets.es-username}}
101+ password : ${{secrets.es-password}}
102+ credential_id : ${{secrets.credential-id}}
103+ totp_secret : ${{secrets.es-totp-secret}}
104+ file_path : ${{ inputs.output-dir }}/**/*.nupkg
105+ output_path : ${{github.workspace}}/${{ inputs.output-dir }}
106+ malware_block : false
107+ override : false
108+ environment_name : ${{ inputs.nuget-environment }}
109+ clean_logs : true
110+ jvm_max_memory : ${{ inputs.jvm-max-memory }}
111+ signing_method : v1
112+
113+ - name : Verify NuGet Packages (if NuGet signing was performed)
114+ if : inputs.enable-nuget-signing
115+ run : |
116+ echo "Verifying signed NuGet packages..."
117+ if [ -d "${{ inputs.output-dir }}" ]; then
118+ find "${{ inputs.output-dir }}" -name "*.nupkg" -type f | while read -r file; do
119+ echo "Verifying: $file"
120+ dotnet nuget verify "$file" --all || echo "Warning: Could not verify $file"
121+ done
122+ fi
123+
51124 - name : Upload Artifacts
52125 uses : actions/upload-artifact@v4
53126 with :
0 commit comments