-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from kambala-decapitator/macos-sign-notarize
[macOS] sign & notarize
- Loading branch information
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
# working directory - .app/Contents | ||
|
||
if [ -z "$CODE_SIGN_IDENTITY" ] ; then | ||
echo 'skip signing - no code sign identity provided in CODE_SIGN_IDENTITY' | ||
exit 0 | ||
fi | ||
|
||
function sign { | ||
codesign --verbose=4 --force --timestamp --options=runtime --sign "$CODE_SIGN_IDENTITY" "$1" | ||
} | ||
|
||
|
||
echo 'sign frameworks' | ||
for framework in Frameworks/*.framework ; do | ||
sign "$framework" | ||
done | ||
|
||
echo 'sign dylibs' | ||
for lib in $(find PlugIns -type f -iname '*.dylib') ; do | ||
sign "$lib" | ||
done | ||
|
||
echo 'sign app bundle' | ||
sign .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
set(dmgPath "${CPACK_PACKAGE_FILES}") | ||
|
||
if(NOT DEFINED ENV{CODE_SIGN_IDENTITY}) | ||
message("skip dmg signing & notarization - no code sign identity provided in CODE_SIGN_IDENTITY") | ||
return() | ||
endif() | ||
message("sign dmg") | ||
execute_process(COMMAND | ||
codesign --verbose=4 --force --sign "$ENV{CODE_SIGN_IDENTITY}" "${dmgPath}" | ||
) | ||
|
||
if(NOT DEFINED ENV{ASC_API_KEY} OR NOT DEFINED ENV{ASC_API_KEY_ID} OR NOT DEFINED ENV{ASC_API_KEY_ISSUER} OR NOT DEFINED ENV{ASC_TEAM_ID}) | ||
message("skip dmg notarization - ASC_API_KEY / ASC_API_KEY_ID / ASC_API_KEY_ISSUER / ASC_TEAM_ID not provided") | ||
return() | ||
endif() | ||
message("notarize dmg") | ||
execute_process(COMMAND | ||
xcrun notarytool submit | ||
--verbose | ||
--key "$ENV{ASC_API_KEY}" | ||
--key-id "$ENV{ASC_API_KEY_ID}" | ||
--issuer "$ENV{ASC_API_KEY_ISSUER}" | ||
--team-id "$ENV{ASC_TEAM_ID}" | ||
--wait | ||
--timeout 30m | ||
"${dmgPath}" | ||
) | ||
execute_process(COMMAND | ||
xcrun stapler staple "${dmgPath}" | ||
) |