Skip to content

Commit 16d8a39

Browse files
committed
git-artifacts: also code-sign, if configured via the secrets
When the secrets `CODESIGN_P12` and `CODESIGN_PASS` are set, the workflow will now code-sign the `.exe` files contained in the package. This should help with a few anti-malware programs, at least when the certificate saw some action and gained trust. Note: `CODESIGN_P12` needs to be generated via cat <certificate>.p12 | base64 | tr '\n' % Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 6535e3f commit 16d8a39

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/git-artifacts.yml

+12
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ jobs:
135135
git remote add -f origin https://github.com/git-for-windows/git &&
136136
git fetch --tags bundle-artifacts/git.bundle $(cat bundle-artifacts/next_version) &&
137137
git reset --hard $(cat bundle-artifacts/next_version)
138+
- name: Prepare home directory for code-signing
139+
env:
140+
CODESIGN_P12: ${{secrets.CODESIGN_P12}}
141+
CODESIGN_PASS: ${{secrets.CODESIGN_PASS}}
142+
if: env.CODESIGN_P12 != '' && env.CODESIGN_PASS != ''
143+
shell: bash
144+
run: |
145+
cd home &&
146+
mkdir -p .sig &&
147+
echo -n "$CODESIGN_P12" | tr % '\n' | base64 -d >.sig/codesign.p12 &&
148+
echo -n "$CODESIGN_PASS" >.sig/codesign.pass
149+
git config --global alias.signtool '!sh "/usr/src/build-extra/signtool.sh"'
138150
- name: Prepare home directory for GPG signing
139151
if: env.GPGKEY != ''
140152
shell: bash

0 commit comments

Comments
 (0)