-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(macos): sign macos application (#699)
* sign macos app * notarize macos app * bundle app as .dmg image * sign image * fix how framework files are bundled in .app
- Loading branch information
Showing
6 changed files
with
196 additions
and
39 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
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,25 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
echo "Create keychain profile" | ||
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$MACOS_NOTARIZATION_APPLE_ID" --team-id "$MACOS_NOTARIZATION_TEAM_ID" --password "$MACOS_NOTARIZATION_PASSWORD" | ||
|
||
# We can't notarize an app bundle directly, but we need to compress it as an archive. | ||
# Therefore, we create a zip file containing our app bundle, so that we can send it to the | ||
# notarization service | ||
|
||
echo "Creating temp notarization archive" | ||
ditto -c -k --keepParent "artifact/Mizer.app" "notarization.zip" | ||
|
||
# Here we send the notarization request to the Apple's Notarization service, waiting for the result. | ||
# This typically takes a few seconds inside a CI environment, but it might take more depending on the App | ||
# characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if | ||
# you're curious | ||
|
||
echo "Notarize app" | ||
xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait | ||
|
||
# Finally, we need to "attach the staple" to our executable, which will allow our app to be | ||
# validated by macOS even when an internet connection is not available. | ||
echo "Attach staple" | ||
xcrun stapler staple "artifact/Mizer.app" |
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,15 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
echo "Packaging as .dmg..." | ||
create-dmg --volname Mizer \ | ||
--volicon "artifact/Mizer.app/Contents/Resources/AppIcon.icns" \ | ||
--window-pos 200 120 \ | ||
--window-size 800 400 \ | ||
--icon-size 100 \ | ||
--icon "Mizer.app" 200 190 \ | ||
--hide-extension "Mizer.app" \ | ||
--app-drop-link 600 185 \ | ||
--codesign "$MACOS_CERTIFICATE_NAME" \ | ||
Mizer.dmg \ | ||
artifact |
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,15 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
echo "Preparing keychain..." | ||
echo "$MACOS_CERTIFICATE" | base64 --decode >certificate.p12 | ||
security create-keychain -p "$MACOS_KEYCHAIN_PASSWORD" build.keychain | ||
security default-keychain -s build.keychain | ||
security unlock-keychain -p "$MACOS_KEYCHAIN_PASSWORD" build.keychain | ||
wget https://www.apple.com/certificateauthority/DeveloperIDG2CA.cer | ||
security import DeveloperIDG2CA.cer -k build.keychain -T /usr/bin/codesign | ||
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PASSWORD" -T /usr/bin/codesign | ||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_KEYCHAIN_PASSWORD" build.keychain | ||
|
||
echo "Signing app..." | ||
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" --options runtime --deep ./artifact/Mizer.app -v |