Permalink
Browse files

Release build script

  • Loading branch information...
andreyvit committed Oct 5, 2010
1 parent ca1fa3c commit 5dcc0ff70a4a9af7eb0d61e6584032693e5a9601
Showing with 70 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +69 −0 SkypePushToTalk/release
View
@@ -4,3 +4,4 @@
*.pbxuser
*.perspectivev3
*/build/
+/builds/
View
@@ -0,0 +1,69 @@
+#! /bin/bash
+VER=$1
+cd "$(dirname "$0")"
+PROJECT_DIR="$(pwd)"
+PROJECT="$(basename "$(pwd)")"
+BUILDS_DIR=../builds
+XCODE_BUILD_DIR=~/Documents/XBuilds
+BUNDLE_NAME=$PROJECT.app
+
+mkdir -p $BUILDS_DIR
+cd $BUILDS_DIR
+BUILDS_DIR="$(pwd)"
+cd $PROJECT_DIR
+
+BUNDLE=$XCODE_BUILD_DIR/Release/$BUNDLE_NAME
+ZIP=$BUILDS_DIR/$PROJECT-$VER.zip
+
+
+test -z "$VER" && {
+ echo "Release a source zip of $PROJECT."
+ echo ""
+ echo "Usage: ./release 1.2.3"
+ echo ""
+ exit 1
+}
+git --version >/dev/null 2>&1 || {
+ echo "Git is required to run this script."
+ exit 1
+}
+
+
+echo
+echo "Releasing $PROJECT $VER:"
+
+echo " -> git tag v$VER"
+git tag v$VER || {
+ echo " *** git tag failed. Stop."
+ echo
+ echo "To rebuild an already built version, run:"
+ echo " git tag -d v$VER"
+ exit 1
+}
+
+PREV_VER=$(agvtool mvers -terse1)
+echo " -> updating version from $PREV_VER to $VER"
+agvtool new-marketing-version $VER >/dev/null || {
+ echo " *** avgtool failed. Stop."
+ exit 1
+}
+
+echo " -> building a release version"
+xcodebuild || {
+ echo " *** xcodebuild failed. Stop."
+ exit 1
+}
+
+test -d $BUNDLE || {
+ echo " *** $BUNDLE does not exist. Stop."
+ exit 1
+}
+
+echo " -> zipping the app bundle into $(basename $ZIP)"
+cd "$(dirname $BUNDLE)"
+zip -rq $ZIP "$(basename $BUNDLE)"
+
+echo
+echo "Done: see $ZIP"
+echo
+open -R "$ZIP"

0 comments on commit 5dcc0ff

Please sign in to comment.