mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-16 03:57:46 -07:00
add
This commit is contained in:
parent
a5fe1ebd0a
commit
2e4030ccca
1 changed files with 14 additions and 6 deletions
|
|
@ -25,7 +25,6 @@ APP_BUNDLE_PATH="$1"
|
||||||
# Verify that the app bundle exists
|
# Verify that the app bundle exists
|
||||||
if [[ ! -e "$APP_BUNDLE_PATH" ]]; then
|
if [[ ! -e "$APP_BUNDLE_PATH" ]]; then
|
||||||
echo "::error file=$0::App bundle not found at: $APP_BUNDLE_PATH"
|
echo "::error file=$0::App bundle not found at: $APP_BUNDLE_PATH"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Sign the app bundle
|
# Sign the app bundle
|
||||||
|
|
@ -43,25 +42,34 @@ fi
|
||||||
if [[ -n "$MACOS_NOTARIZATION_APPLE_ID" ]]; then
|
if [[ -n "$MACOS_NOTARIZATION_APPLE_ID" ]]; then
|
||||||
echo "::group::Notarize app bundle"
|
echo "::group::Notarize app bundle"
|
||||||
# Store the notarization credentials so that we can prevent a UI password dialog from blocking the CI
|
# Store the notarization credentials so that we can prevent a UI password dialog from blocking the CI
|
||||||
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_PWD"
|
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$MACOS_NOTARIZATION_APPLE_ID" --team-id "$MACOS_NOTARIZATION_TEAM_ID" --password "$MACOS_NOTARIZATION_PWD"
|
||||||
|
|
||||||
# We can't notarize an app bundle directly, but we need to compress it as an archive.
|
# 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
|
# Therefore, we create a zip file containing our app bundle, so that we can send it to the notarization service
|
||||||
|
echo ""
|
||||||
echo "Creating temp notarization archive"
|
echo "Creating temp notarization archive"
|
||||||
ditto -c -k --keepParent "$APP_BUNDLE_PATH" "notarization.zip"
|
ditto -c -k --keepParent "$APP_BUNDLE_PATH" "notarization.zip"
|
||||||
|
|
||||||
# Here we send the notarization request to the Apple's Notarization service, waiting for the result.
|
# 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.
|
# 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.
|
# Visit the Notarization docs for more information and strategies on how to optimize it if you're curious.
|
||||||
echo "Notarize app"
|
echo ""
|
||||||
xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait
|
xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait
|
||||||
|
echo "::endgroup::"
|
||||||
|
|
||||||
|
echo "::group::Staple app"
|
||||||
# Finally, we need to "attach the staple" to our executable, which will allow our app to be
|
# 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.
|
# validated by macOS even when an internet connection is not available.
|
||||||
echo "Attach staple"
|
echo "Attach staple"
|
||||||
xcrun stapler staple "$APP_BUNDLE_PATH"
|
xcrun stapler staple "$APP_BUNDLE_PATH"
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
|
echo "::group::Cleanup"
|
||||||
|
# Cleanup keychain and files to avoid leaking credentials
|
||||||
|
echo "Deleting keychain"
|
||||||
|
security delete-keychain build.keychain
|
||||||
|
rm -f certificate.p12 notarization.zip
|
||||||
|
echo "::endgroup::"
|
||||||
else
|
else
|
||||||
echo "::error file=$0::MACOS_NOTARIZATION_APPLE_ID not set. Can not notarize the app bundle."
|
echo "::error file=$0::MACOS_NOTARIZATION_APPLE_ID not set. Can not notarize the app bundle."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue