Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add codesign for macos build #7971

Merged
merged 4 commits into from
Apr 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions build/mac/makedist_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ touch dist/installdir

mkdir -p dist/temp

# Sign the app if environment variables are set
if [ -n "$CODE_SIGN_ENABLED" ] && [ -n "$APPLE_DEV_ID" ]; then
echo "Signing $APPNAME.app with ID: $APPLE_DEV_ID"
SIGN_MSG="Developer ID Application: $APPLE_DEV_ID"
codesign --deep --force --verbose --sign "$SIGN_MSG" --options runtime dist/installdir/$APPNAME.app
fi

# create image
hdiutil create -fs HFS+ -srcfolder dist/installdir -format UDRW -scrub -volname ${APPNAME} dist/$APPNAME.dmg

Expand Down Expand Up @@ -109,3 +116,10 @@ python3 ./build/mac/licenseDMG.py dist/$APPNAME.dmg LICENSE
if [ ! -z "$DMGNAME" ]; then
mv dist/$APPNAME.dmg dist/$DMGNAME.dmg
fi

# Sign the dmg package and verify it
if [ -n "$CODE_SIGN_ENABLED" ] && [ -n "$APPLE_DEV_ID" ]; then
codesign --force --verify --verbose --sign "$SIGN_MSG" dist/$DMGNAME.dmg
codesign --verify --verbose=4 dist/$DMGNAME.dmg
spctl --assess --type open --context context:primary-signature -v dist/$DMGNAME.dmg
fi
Loading