Skip to content
Permalink
Browse files

notarization script

  • Loading branch information
youknowone committed Nov 17, 2019
1 parent f66a372 commit b005b426adeb57501f5f0c5d642f7c4b7558813c
Showing with 69 additions and 8 deletions.
  1. +12 −0 OSX/ExportOptions.plist
  2. +4 −8 tools/{build_product.sh → archive_product.sh}
  3. +53 −0 tools/package_product.sh
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>teamID</key>
<string>9384JEL3M9</string>
<key>method</key>
<string>developer-id</string>
<key>signingStyle</key>
<string>automatic</string>
</dict>
</plist>
@@ -15,10 +15,6 @@ if [ "${CONFIGURATION}" != 'Release' ]; then
read -r
fi

# shellcheck disable=2034
APPLICATION_KEY="Developer ID Application: YunWon Jeong"
INSTALLER_KEY="Developer ID Installer: YunWon Jeong"

BUILT_PRODUCT_PATH="${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app"

rm ~/Downloads/"${PACKAGE_NAME}.pkg"
@@ -30,8 +26,8 @@ else
PRINTER="cat"
fi

(xcodebuild -workspace 'Gureum.xcworkspace' -scheme 'OSX' -configuration "${CONFIGURATION}" | $PRINTER) && \
productbuild --product "tools/preinst.plist" --component "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app" '/Library/Input Methods' --sign "${INSTALLER_KEY}" ~/Downloads/"${PACKAGE_NAME}.pkg"
#tar -zcf "${PACKAGE_NAME}.app.tar.gz" "${PRODUCT_NAME}.app"
(xcodebuild -workspace 'Gureum.xcworkspace' -scheme 'OSX' -configuration "${CONFIGURATION}" archive | $PRINTER) && \
echo "Archive dir path is required for further packaging (try paste)" && echo "Archive directory path>" && read -r archive_dir

bash "${SCRIPT_DIR}/package_product.sh" "$archive_dir"

grep Copyright "${BUILT_PRODUCT_PATH}/Contents/Info.plist"
@@ -0,0 +1,53 @@
#!/bin/bash
#https://discuss.atom.io/t/sandbox-supposedly-enabled-but-application-loader-disagrees/26155
set -o pipefail

if [ ! "${CONFIGURATION}" ]; then
CONFIGURATION='Release'
fi

SCRIPT_DIR="$(dirname "$0")"
# shellcheck source=tools/ready.sh
. "${SCRIPT_DIR}/ready.sh" || exit $?

# shellcheck disable=2034
APPLICATION_KEY="Developer ID Application: YunWon Jeong"
INSTALLER_KEY="Developer ID Installer: YunWon Jeong"

ZIP_PATH=$1/Gureum.zip
APP_PATH=$1/Gureum.app

if [ ! "$1" ]; then
echo "run archive and put archive path as 1st argument"
exit 1
fi

if [ ! -e "$1" ]; then
echo "unexisting path: $1"
exit 1
fi

if [ ! -e "$ZIP_PATH" ] || [ ! -e "$APP_PATH" ]; then
echo "The given path doesn't include .zip or .app $ZIP_PATH $APP_PATH"
exit 1
fi

PKG_PATH=~/"Downloads/${PACKAGE_NAME}.pkg"

productbuild --product "tools/preinst.plist" --component "${APP_PATH}" '/Library/Input Methods' \
--sign "${INSTALLER_KEY}" "${PKG_PATH}"

grep Copyright "${APP_PATH}/Contents/Info.plist"

echo "Apple login ID is required to notarize products"
echo "Apple ID>"

read -r apple_id

echo "Notarizing app..."
xcrun altool --notarize-app -t osx --primary-bundle-id org.youknowone.inputmethod.Gureum \
-u "$apple_id" -p @keychain:developer.apple.com -itc_provider 9384JEL3M9 -f "${ZIP_PATH}"

echo "Notarizing pkg..."
xcrun altool --notarize-app -t osx --primary-bundle-id org.youknowone.inputmethod.Gureum \
-u "$apple_id" -p @keychain:developer.apple.com -f "$PKG_PATH"

0 comments on commit b005b42

Please sign in to comment.
You can’t perform that action at this time.