Created
October 26, 2013 14:56
-
-
Save danielctull/7170326 to your computer and use it in GitHub Desktop.
My tag + upload post Archive Scheme Script
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
| echo "Starting Tag and upload to TestFlight with configuration: ${CONFIGURATION}" | |
| if [[ ${CONFIGURATION} != "Release" ]]; then | |
| exit | |
| fi | |
| cd ${SRCROOT} | |
| PREVIOUSTAG=`git tag | grep "$s." | sort -r | head -1` | |
| TAG="s.`git log --oneline | wc -l | tr -d ' '`" | |
| echo "Previous tag: $PREVIOUSTAG" | |
| echo "New tag: $TAG" | |
| if [[ $TAG == $PREVIOUSTAG ]]; then | |
| exit | |
| fi | |
| CHANGELOG=`git log $PREVIOUSTAG..HEAD --merges --pretty=format:"* %s" --reverse | grep -v "$Merge branch"` | |
| FIRSTCHAR=$(echo "$CHANGELOG" | head -c 1) | |
| if [[ "$FIRSTCHAR" != "*" ]]; then | |
| CHANGELOG="No release notes with this build." | |
| fi | |
| echo "$CHANGELOG" | |
| git tag -a -m "$CHANGELOG" $TAG | |
| git push origin --tags | |
| APP="${ARCHIVE_PRODUCTS_PATH}${INSTALL_PATH}/${WRAPPER_NAME}" | |
| IPA="${BUILT_PRODUCTS_DIR}.ipa" | |
| DSYM="${ARCHIVE_DSYMS_PATH}/${DWARF_DSYM_FILE_NAME}" | |
| ZIPPED_DSYM="${BUILT_PRODUCTS_DIR}/${DWARF_DSYM_FILE_NAME}.zip" | |
| echo "APP: $APP" | |
| echo "IPA: $IPA" | |
| echo "DSYM: $DSYM" | |
| echo "ZIPPED_DSYM: $ZIPPED_DSYM" | |
| rm -f "$IPA" | |
| xcrun -sdk iphoneos PackageApplication -v "$APP" -o "$IPA" | |
| rm -f "$ZIPPED_DSYM" | |
| zip -r "$ZIPPED_DSYM" "$DSYM" | |
| HOCKEYAPP_API_TOKEN="" | |
| SHA=`git rev-parse HEAD` | |
| curl "https://rink.hockeyapp.net/api/2/apps" \ | |
| -F "status=2" \ | |
| -F "release_type=0" \ | |
| -F "notify=1" \ | |
| -F notes="$CHANGELOG" \ | |
| -F notes_type=0 \ | |
| -F commit_sha="$SHA" \ | |
| -F ipa=@"$IPA" \ | |
| -F dsym=@"$ZIPPED_DSYM" \ | |
| -H "X-HockeyAppToken: $HOCKEYAPP_API_TOKEN" | |
| TESTFLIGHT_API_TOKEN="" | |
| TESTFLIGHT_TEAM_TOKEN="" | |
| DISTRIBUTION_LISTS="Issues" | |
| curl "http://testflightapp.com/api/builds.json" \ | |
| -F file=@"$IPA" \ | |
| -F api_token="$TESTFLIGHT_API_TOKEN" \ | |
| -F team_token="$TESTFLIGHT_TEAM_TOKEN" \ | |
| -F notes="$CHANGELOG" \ | |
| -F distribution_lists="$DISTRIBUTION_LISTS" \ | |
| -F notify=True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment