Skip to content

Commit 9902228

Browse files
authored
Merge pull request #7971 from xoriole/fix/macos-sign
Add codesign for macos build
2 parents bc12346 + c6f93db commit 9902228

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

build/mac/makedist_macos.sh

+14
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ touch dist/installdir
4747

4848
mkdir -p dist/temp
4949

50+
# Sign the app if environment variables are set
51+
if [ -n "$CODE_SIGN_ENABLED" ] && [ -n "$APPLE_DEV_ID" ]; then
52+
echo "Signing $APPNAME.app with ID: $APPLE_DEV_ID"
53+
SIGN_MSG="Developer ID Application: $APPLE_DEV_ID"
54+
codesign --deep --force --verbose --sign "$SIGN_MSG" --options runtime dist/installdir/$APPNAME.app
55+
fi
56+
5057
# create image
5158
hdiutil create -fs HFS+ -srcfolder dist/installdir -format UDRW -scrub -volname ${APPNAME} dist/$APPNAME.dmg
5259

@@ -109,3 +116,10 @@ python3 ./build/mac/licenseDMG.py dist/$APPNAME.dmg LICENSE
109116
if [ ! -z "$DMGNAME" ]; then
110117
mv dist/$APPNAME.dmg dist/$DMGNAME.dmg
111118
fi
119+
120+
# Sign the dmg package and verify it
121+
if [ -n "$CODE_SIGN_ENABLED" ] && [ -n "$APPLE_DEV_ID" ]; then
122+
codesign --force --verify --verbose --sign "$SIGN_MSG" dist/$DMGNAME.dmg
123+
codesign --verify --verbose=4 dist/$DMGNAME.dmg
124+
spctl --assess --type open --context context:primary-signature -v dist/$DMGNAME.dmg
125+
fi

0 commit comments

Comments
 (0)