gogcli/scripts/codesign-macos.sh
Peter Steinberger 2c9c1dcc8b
Some checks failed
ci / test (push) Has been cancelled
ci / worker (push) Has been cancelled
ci / windows (push) Has been cancelled
ci / darwin-cgo-build (push) Has been cancelled
pages / Deploy docs (push) Has been cancelled
build: sign macos release binaries
2026-05-05 17:06:03 +01:00

24 lines
542 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
BIN="${1:-}"
if [[ -z "$BIN" ]]; then
echo "usage: $0 <path-to-binary>" >&2
exit 2
fi
if [[ "$(uname -s)" != "Darwin" ]]; then
exit 0
fi
IDENTITY="${GOG_CODESIGN_IDENTITY:-${CODESIGN_IDENTITY:-}}"
if [[ -z "$IDENTITY" ]]; then
echo "codesign: skipped (set GOG_CODESIGN_IDENTITY or CODESIGN_IDENTITY)" >&2
exit 0
fi
ID="com.steipete.gogcli.gog"
codesign --force --sign "$IDENTITY" --timestamp --options runtime --identifier "$ID" "$BIN"
codesign --verify --deep --strict --verbose=2 "$BIN"