4
4
workflow_call :
5
5
inputs :
6
6
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 })
8
8
required : true
9
9
type : string
10
10
output-dir :
17
17
required : false
18
18
type : number
19
19
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
20
35
secrets :
21
36
gpg-private-key :
22
37
required : true
23
38
gpg-public-key :
24
39
required : true
25
40
gpg-key-pass :
26
41
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
+
27
55
permissions :
28
56
contents : read
29
57
packages : read
58
+
30
59
jobs :
31
60
sign :
32
61
runs-on : ubuntu-22.04
@@ -44,10 +73,54 @@ jobs:
44
73
run : |
45
74
sudo apt-get update && sudo apt-get install dpkg-sig dpkg-dev -y
46
75
47
- - name : Sign Artifacts
76
+ - name : Sign Artifacts with GPG
48
77
run : |
49
78
chmod +x ${{ github.workspace }}/.github/workflows/sign-artifacts/entrypoint.sh
50
79
${{ 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
+
51
124
- name : Upload Artifacts
52
125
uses : actions/upload-artifact@v4
53
126
with :
0 commit comments