Skip to content

Commit 2a09b5e

Browse files
author
Matthew Preble
committed
Migrate to osslsigncode.
1 parent 036d26a commit 2a09b5e

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

.github/workflows/releases.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
-q .body > CHANGELOG.md
2626
env:
2727
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
28+
- name: Install osslsigncode
29+
run: sudo apt-get install -y osslsigncode
2830
- name: Run GoReleaser
2931
uses: goreleaser/goreleaser-action@v2
3032
with:

script/sign-windows-executable.sh

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,18 @@ curl \
99
--output windows-certificate.pfx \
1010
https://api.github.com/repos/desktop/desktop-secrets/contents/windows-certificate.pfx
1111

12-
PROGRAM_NAME="GitHub CLI"
13-
14-
# Convert private key to the expected format
1512
openssl pkcs12 -in windows-certificate.pfx -nocerts -nodes -out private-key.pem -passin pass:${GITHUB_CERT_PASSWORD}
16-
openssl rsa -in private-key.pem -outform PVK -pvk-none -out private-key.pvk
17-
18-
# Convert certificate chain into the expected format
1913
openssl pkcs12 -in windows-certificate.pfx -nokeys -nodes -out certificate.pem -passin pass:${GITHUB_CERT_PASSWORD}
20-
openssl crl2pkcs7 -nocrl -certfile certificate.pem -outform DER -out certificate.spc
2114

22-
signcode \
23-
-spc certificate.spc \
24-
-v private-key.pvk \
25-
-n $PROGRAM_NAME \
15+
osslsigncode sign \
16+
-certs certificate.pem \
17+
-key private-key.pem \
18+
-n "GitHub CLI" \
2619
-t http://timestamp.digicert.com \
27-
-a sha256 \
28-
$EXECUTABLE_PATH
20+
-in $EXECUTABLE_PATH \
21+
-out gh_signed.exe
22+
23+
# Oddly, there can be a delay before the file is *actually* available - wait for it
24+
while [ ! -f gh_signed.exe ]; do sleep 1; done;
25+
26+
mv gh_signed.exe $EXECUTABLE_PATH

0 commit comments

Comments
 (0)