blob: 667a91467f257a005487bf24de080ef7ff9a9fef [file] [log] [blame]
Kateryna Kostiukeee16cd2018-05-25 10:12:25 -04001#!/bin/bash
2
3echo ""
4cd build-local
5macdeployqt ./Ring.app
6echo "cloning certificates"
7git clone $CERTIFICATES_REPOSITORY
8echo "prepare keychain"
9security create-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN_NAME
10security unlock-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN_NAME
11security list-keychains -s $KEYCHAIN_NAME
12security set-key-partition-list -S apple-tool:,apple:,productbuild: -s -k $KEYCHAIN_PASSWORD $KEYCHAIN_NAME
13echo "import certificates"
14security import certificates/certificates/distribution/Certificates.p12 -k $KEYCHAIN_PATH -P $CERTIFICATES_PASSWORD -T /usr/bin/codesign -T /usr/bin/productbuild
15DELIVER_PASSWORD=$APPLE_PASSWORD fastlane sigh --app_identifier $BUNDLE_ID --username $APPLE_ACCOUNT --readonly true --platform macos --team_id $TEAM_ID
16security set-key-partition-list -S apple-tool:,apple:,productbuild: -s -k $KEYCHAIN_PASSWORD $KEYCHAIN_NAME
17echo "start signing"
18codesign --deep --force --verbose --sign "${APP_CERTIFICATE}" --entitlements ../data/Ring.entitlements Ring.app
19codesign --verify --verbose Ring.app
20echo "create .pkg"
21productbuild --component Ring.app/ /Applications --sign "${INSTALLER_CERTIFICATE}" --product Ring.app/Contents/Info.plist Ring.pkg
22pkgutil --check-signature Ring.pkg
23/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool --validate-app --type osx -f Ring.pkg -u $APPLE_ACCOUNT --password $APPLE_PASSWORD
24echo "start deploying"
25/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool --upload-app --type osx -f Ring.pkg -u $APPLE_ACCOUNT --password $APPLE_PASSWORD