github.com/mutagen-io/mutagen@v0.18.0-rc1/scripts/ci/notarize.sh (about) 1 #!/bin/bash 2 3 # Exit immediately on failure. 4 set -e 5 6 # Determine the operating system. 7 MUTAGEN_OS_NAME="$(go env GOOS)" 8 9 # Perform a build that's appropriate for the platform. 10 if [[ "${MUTAGEN_OS_NAME}" == "darwin" ]]; then 11 # Generate the zip archives needed for uploading to the notarization server. 12 /usr/bin/ditto -c -k --keepParent build/cli/darwin_amd64 "${RUNNER_TEMP}/notarize_cli_darwin_amd64.zip" 13 /usr/bin/ditto -c -k --keepParent build/cli/darwin_arm64 "${RUNNER_TEMP}/notarize_cli_darwin_arm64.zip" 14 /usr/bin/ditto -c -k --keepParent build/agent/darwin_amd64 "${RUNNER_TEMP}/notarize_agent_darwin_amd64.zip" 15 /usr/bin/ditto -c -k --keepParent build/agent/darwin_arm64 "${RUNNER_TEMP}/notarize_agent_darwin_arm64.zip" 16 17 # Notarize each archive individually. 18 find "${RUNNER_TEMP}" -name 'notarize_*.zip' -exec \ 19 xcrun notarytool submit \ 20 --wait \ 21 --apple-id "${MACOS_NOTARIZE_APPLE_ID}" \ 22 --password "${MACOS_NOTARIZE_APP_SPECIFIC_PASSWORD}" \ 23 --team-id "${MACOS_NOTARIZE_TEAM_ID}" \ 24 {} \; 25 26 # Remove the archives. 27 find "${RUNNER_TEMP}" -name 'notarize_*.zip' -exec rm -rf {} \; 28 else 29 echo "This script is not supported on this platform" 1>&2 30 exit 1 31 fi