Skip to content
Permalink
Browse files

notarization script

  • Loading branch information
youknowone committed Nov 17, 2019
1 parent f66a372 commit 16e6a6b6a90ac37d447ff7064ebe98cd106db58e
Showing with 66 additions and 9 deletions.
  1. +12 −0 tools/ExportOptions.plist
  2. +5 −8 tools/{build_product.sh → archive_product.sh}
  3. +44 −0 tools/notarize_product.sh
  4. +5 −1 tools/ready.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,9 @@ 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 || \
exit $?

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

grep Copyright "${BUILT_PRODUCT_PATH}/Contents/Info.plist"
@@ -0,0 +1,44 @@
#!/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 $?

ZIP_PATH=$1/${PACKAGE_NAME}.zip
PKG_PATH=$1/${PACKAGE_NAME}.pkg

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 "$PKG_PATH" ]; then
echo "The given path doesn't include .zip or .pkg $ZIP_PATH $PKG_PATH"
exit 1
fi

echo "Apple login ID is required to notarize products"
echo -n "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"

mv "$PKG_PATH" ~/Downloads/
@@ -8,6 +8,8 @@ TMPSCRIPT="${TMPDIR}gureumbuild"

if [ -e "${TMPSCRIPT}" ]; then
echo "unexpected existing file: ${TMPSCRIPT}"
echo "현재 다른 구름 빌드가 진행중이거나, 이전의 구름 빌드가 불완전하게 종료되었을 수 있습니다."
echo "다른 구름 빌드가 실행중이 아니라면 이 파일을 삭제 후 다시 실행해 주세요."
exit 255
fi

@@ -17,7 +19,9 @@ fi

echo "Configuration: ${CONFIGURATION}"

(xcodebuild -workspace 'Gureum.xcworkspace' -scheme 'ScriptSupport' -configuration "${CONFIGURATION}" | grep export > "${TMPSCRIPT}") || exit $?
(xcodebuild -workspace 'Gureum.xcworkspace' -scheme 'ScriptSupport' \
-configuration "${CONFIGURATION}" | grep export > "${TMPSCRIPT}") || \
exit $?
# shellcheck disable=1090
. "${TMPSCRIPT}" > /dev/null 2>&1
rm "${TMPSCRIPT}"

0 comments on commit 16e6a6b

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