Created
August 22, 2014 14:04
-
-
Save inf0rmer/bdd83c41ecd1adad6856 to your computer and use it in GitHub Desktop.
Automatically uploads a build to Testflight using Travis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!/bin/sh | |
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then | |
echo "This is a pull request. No deployment will be done." | |
exit 0 | |
fi | |
if [[ "$TRAVIS_BRANCH" != "master" ]]; then | |
echo "Testing on a branch other than master. No deployment will be done." | |
exit 0 | |
fi | |
echo "************************************" | |
echo "* Installing Dependencies *" | |
echo "************************************" | |
brew unlink imagemagick ghostscript | |
brew install imagemagick ghostscript | |
echo "********************" | |
echo "* Building *" | |
echo "********************" | |
xctool -workspace Clubjudge.xcworkspace -scheme Release -sdk iphoneos -configuration Release OBJROOT=$PWD/build SYMROOT=$PWD/build ONLY_ACTIVE_ARCH=NO | |
# Thanks @djacobs https://gist.github.com/djacobs/2411095 | |
PROVISIONING_PROFILE="$HOME/Library/MobileDevice/Provisioning Profiles/$PROFILE_UUID.mobileprovision" | |
RELEASE_DATE=`date '+%Y-%m-%d %H:%M:%S'` | |
OUTPUTDIR="$PWD/build/Release-iphoneos" | |
echo "********************" | |
echo "* Signing *" | |
echo "********************" | |
xcrun -log -sdk iphoneos PackageApplication "$OUTPUTDIR/$APPNAME.app" -o "$OUTPUTDIR/$APPNAME.ipa" -sign "$DEVELOPER_NAME" -embed "$PROVISIONING_PROFILE" | |
RELEASE_NOTES="Build: $TRAVIS_BUILD_NUMBER\nUploaded: $RELEASE_DATE" | |
zip -r -9 "$OUTPUTDIR/$APPNAME.app.dSYM.zip" "$OUTPUTDIR/$APPNAME.app.dSYM" | |
echo "********************" | |
echo "* Uploading *" | |
echo "********************" | |
curl http://testflightapp.com/api/builds.json \ | |
-F file="@$OUTPUTDIR/$APPNAME.ipa" \ | |
-F dsym="@$OUTPUTDIR/$APPNAME.app.dSYM.zip" \ | |
-F api_token="$API_TOKEN" \ | |
-F team_token="$TEAM_TOKEN" \ | |
-F distribution_lists='$DISTRIBUTION_LISTS' \ | |
-F notes="$RELEASE_NOTES" -v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment