mirror of
https://github.com/goreleaser/nfpm
synced 2026-11-29 13:04:56 +01:00
macos-linux-build cross-compiles the test app and packages it as an installer package, an application bundle and a disk image, unsigned and signed with a throwaway certificate. Where the repository's Apple Developer ID identities are available it also signs with those. macos-verify takes those exact bytes to a macOS runner. The installer installs, upgrades, downgrades and refuses the packages, including ones with non-ASCII names and failing scripts; the bundles are unpacked and launched, the images mounted; pkgutil, codesign and the system trust stack check the signatures, and the signing certificate is compared by fingerprint. Both jobs run on pull requests as well as in the merge queue. macos-acceptance-tests reads all three formats back on Linux for both architectures, in the merge queue like the other structure tests. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
18 lines
758 B
Bash
Executable File
18 lines
758 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Prints the SHA-256 fingerprint of the certificate in a PKCS#12 file as
|
|
# upper-case hex without separators. Only the public certificate is read out.
|
|
# The passphrase is taken from NFPM_PASSPHRASE and may be empty.
|
|
set -euo pipefail
|
|
|
|
p12="${1:?usage: p12-fingerprint.sh identity.p12}"
|
|
pass="pass:${NFPM_PASSPHRASE:-}"
|
|
|
|
# Identities exported from Keychain use ciphers OpenSSL 3 only reads with
|
|
# -legacy; older OpenSSL and LibreSSL do not know the flag.
|
|
certificate="$(openssl pkcs12 -in "$p12" -nokeys -clcerts -passin "$pass" 2>/dev/null ||
|
|
openssl pkcs12 -legacy -in "$p12" -nokeys -clcerts -passin "$pass")"
|
|
|
|
openssl x509 -noout -fingerprint -sha256 <<<"$certificate" |
|
|
cut -d= -f2 | tr -d ':\n' | tr '[:lower:]' '[:upper:]'
|
|
echo
|