16
16
required : true
17
17
type : string
18
18
description : The version of python to use with relenv
19
+ sign-rpm-packages :
20
+ type : boolean
21
+ default : false
22
+ description : Sign RPM Packages
19
23
sign-macos-packages :
20
24
type : boolean
21
25
default : false
45
49
type : string
46
50
description : Json job matrix config
47
51
52
+
48
53
env :
49
54
COLUMNS : 190
50
55
PIP_INDEX_URL : ${{ vars.PIP_INDEX_URL }}
@@ -162,6 +167,7 @@ jobs:
162
167
163
168
build-rpm-packages :
164
169
name : RPM
170
+ environment : ${{ inputs.environment }}
165
171
if : ${{ toJSON(fromJSON(inputs.matrix)['linux']) != '[]' }}
166
172
runs-on :
167
173
- ${{ matrix.arch == 'x86_64' && 'ubuntu-24.04' || inputs.linux_arm_runner }}
@@ -199,6 +205,25 @@ jobs:
199
205
with :
200
206
salt-version : " ${{ inputs.salt-version }}"
201
207
208
+ - name : Setup GnuPG
209
+ if : ${{ inputs.sign-rpm-packages }}
210
+ env :
211
+ SIGNING_GPG_KEY : ${{ secrets.SIGNING_GPG_KEY }}
212
+ SIGNING_PASSPHRASE : ${{ secrets.SIGNING_PASSPHRASE }}
213
+ run : |
214
+ install -d -m 0700 -o "$(id -u)" -g "$(id -g)" /run/gpg
215
+ GNUPGHOME="$(mktemp -d -p /run/gpg)"
216
+ export GNUPGHOME
217
+ echo "GNUPGHOME=${GNUPGHOME}" >> "$GITHUB_ENV"
218
+ cat <<EOF > "${GNUPGHOME}/gpg.conf"
219
+ batch
220
+ no-tty
221
+ pinentry-mode loopback
222
+ passphrase-file ${GNUPGHOME}/passphrase
223
+ EOF
224
+ echo "${SIGNING_PASSPHRASE}" > "${GNUPGHOME}/passphrase"
225
+ echo "${SIGNING_GPG_KEY}" | gpg --import -
226
+
202
227
- name : Configure Git
203
228
if : ${{ startsWith(github.event.ref, 'refs/tags') == false }}
204
229
run : |
@@ -216,7 +241,7 @@ jobs:
216
241
format('--onedir=salt-{0}-onedir-linux-{1}.tar.xz', inputs.salt-version, matrix.arch)
217
242
||
218
243
format('--arch={0}', matrix.arch)
219
- }}
244
+ }} ${{ inputs.sign-rpm-packages && '--key-id=64CBBC8173D76B3F' || '' }}
220
245
221
246
- name : Set Artifact Name
222
247
id : set-artifact-name
@@ -368,6 +393,7 @@ jobs:
368
393
SM_CLIENT_CERT_PASSWORD : " ${{ secrets.WIN_SIGN_CERT_PASSWORD }}"
369
394
SM_CLIENT_CERT_FILE_B64 : " ${{ secrets.WIN_SIGN_CERT_FILE_B64 }}"
370
395
WIN_SIGN_CERT_SHA1_HASH : " ${{ secrets.WIN_SIGN_CERT_SHA1_HASH }}"
396
+ SM_CODE_SIGNING_CERT_SHA1_HASH : " ${{ secrets.WIN_SIGN_CERT_SHA1_HASH }}"
371
397
PIP_INDEX_URL : https://pypi.org/simple
372
398
373
399
steps :
@@ -416,16 +442,17 @@ jobs:
416
442
name : salt-${{ inputs.salt-version }}-onedir-windows-${{ matrix.arch }}.zip
417
443
path : artifacts/
418
444
419
- - name : Code signing with Software Trust Manager
420
- if : ${{ steps.check-pkg-sign.outputs.sign-pkgs == 'true' }}
421
- uses : digicert/ssm-code-signing@v0.0.2
422
-
423
445
- name : Setup Certificate
424
446
if : ${{ steps.check-pkg-sign.outputs.sign-pkgs == 'true' }}
425
447
shell : bash
426
448
run : |
427
449
echo "${{ secrets.WIN_SIGN_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
428
450
451
+
452
+ - name : Code signing with Software Trust Manager
453
+ if : ${{ steps.check-pkg-sign.outputs.sign-pkgs == 'true' }}
454
+ uses : digicert/ssm-code-signing@v0.0.2
455
+
429
456
- name : Build Windows Packages
430
457
run : |
431
458
tools pkg build windows --relenv-version=${{ inputs.relenv-version }} --python-version=${{ inputs.python-version }} ${{
0 commit comments