fleet/orbit/tools/build/sign-macos.sh
Tomas Touceda 3ac8494d23 Add 'orbit/' from commit 'ab3047bb39f1e2be331d1ff18b4eb768619033c4'
git-subtree-dir: orbit
git-subtree-mainline: d5974aad97
git-subtree-split: ab3047bb39
2021-08-04 16:58:25 -03:00

26 lines
476 B
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail
if [ -z "$CODESIGN_IDENTITY" ]
then
echo 'Must set CODESIGN_IDENTITY in environment'
exit 1
fi
if [ ! -f "$1" ]
then
echo 'First argument must be path to binary'
exit 1
fi
# Skip if not a macOS Mach-O executable
if ! ( file "$1" | grep Mach-O )
then
echo 'Skip macOS signing'
exit 0
fi
codesign -s "$CODESIGN_IDENTITY" -i com.fleetdm.orbit -f -v --timestamp --options runtime "$1"
echo "Signed successfully"