Skip to content

Instantly share code, notes, and snippets.

@andrewtheis
Last active December 26, 2015 09:09
Show Gist options
  • Select an option

  • Save andrewtheis/7127573 to your computer and use it in GitHub Desktop.

Select an option

Save andrewtheis/7127573 to your computer and use it in GitHub Desktop.

Revisions

  1. andrewtheis revised this gist Oct 23, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bump_and_tag.sh
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ NEW_BUILD_NUM=$(expr $TAG_BUILD_NUM + 1)
    defaults write "${PLIST_PATH%.*}" 'CFBundleVersion' "${NEW_BUILD_NUM}" &> /dev/null
    BUILD_NUM_SET=`defaults read "${PLIST_PATH%.*}" 'CFBundleVersion'`

    echo "Set build number to ${BUILD_NUM_SET} in ${PLIST_PATH}"
    echo "Set build number to ${BUILD_NUM_SET} in ${INFOPLIST_PATH}"

    # Tag it!
    xcrun git tag ${TAG_VERSION}-${BUILD_NUM_SET}
  2. andrewtheis revised this gist Oct 23, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions bump_and_tag.sh
    Original file line number Diff line number Diff line change
    @@ -12,10 +12,10 @@ NEW_BUILD_NUM=$(expr $TAG_BUILD_NUM + 1)
    defaults write "${PLIST_PATH%.*}" 'CFBundleVersion' "${NEW_BUILD_NUM}" &> /dev/null
    BUILD_NUM_SET=`defaults read "${PLIST_PATH%.*}" 'CFBundleVersion'`

    echo "\t\tSet build number to ${BUILD_NUM_SET} in ${PLIST_PATH}"
    echo "Set build number to ${BUILD_NUM_SET} in ${PLIST_PATH}"

    # Tag it!
    xcrun git tag ${TAG_VERSION}-${BUILD_NUM_SET}
    xcrun git push origin --tags

    echo "\tBumped and tagged."
    echo "Bumped and tagged."
  3. andrewtheis revised this gist Oct 23, 2013. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions bump_and_tag.sh
    Original file line number Diff line number Diff line change
    @@ -11,9 +11,11 @@ NEW_BUILD_NUM=$(expr $TAG_BUILD_NUM + 1)
    # Set the new version
    defaults write "${PLIST_PATH%.*}" 'CFBundleVersion' "${NEW_BUILD_NUM}" &> /dev/null
    BUILD_NUM_SET=`defaults read "${PLIST_PATH%.*}" 'CFBundleVersion'`
    echo "Set build number to ${BUILD_NUM_SET} in ${PLIST_PATH}"

    echo "\t\tSet build number to ${BUILD_NUM_SET} in ${PLIST_PATH}"

    # Tag it!
    xcrun git tag ${TAG_VERSION}-${BUILD_NUM_SET}
    xcrun git push origin --tags
    xcrun git push origin --tags

    echo "\tBumped and tagged."
  4. andrewtheis revised this gist Oct 23, 2013. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions bump_and_tag.sh
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,4 @@ echo "Set build number to ${BUILD_NUM_SET} in ${PLIST_PATH}"

    # Tag it!
    xcrun git tag ${TAG_VERSION}-${BUILD_NUM_SET}
    xcrun git push origin --tags
    TAG_PUSHED=`xcrun git describe --tags --abbrev=0`

    echo "Tagged this commit ${TAG_PUSHED}"
    xcrun git push origin --tags
  5. andrewtheis revised this gist Oct 23, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bump_and_tag.sh
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ echo "Set build number to ${BUILD_NUM_SET} in ${PLIST_PATH}"

    # Tag it!
    xcrun git tag ${TAG_VERSION}-${BUILD_NUM_SET}
    git push origin --tags
    xcrun git push origin --tags
    TAG_PUSHED=`xcrun git describe --tags --abbrev=0`

    echo "Tagged this commit ${TAG_PUSHED}"
  6. andrewtheis created this gist Oct 23, 2013.
    22 changes: 22 additions & 0 deletions bump_and_tag.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    #!/bin/sh

    PLIST_PATH="${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}"

    # Get the current version and extract the version/build from there
    LATEST_TAG=`xcrun git describe --tags --abbrev=0`
    TAG_BUILD_NUM=${LATEST_TAG#*-}
    TAG_VERSION=${LATEST_TAG%-*}
    NEW_BUILD_NUM=$(expr $TAG_BUILD_NUM + 1)

    # Set the new version
    defaults write "${PLIST_PATH%.*}" 'CFBundleVersion' "${NEW_BUILD_NUM}" &> /dev/null
    BUILD_NUM_SET=`defaults read "${PLIST_PATH%.*}" 'CFBundleVersion'`

    echo "Set build number to ${BUILD_NUM_SET} in ${PLIST_PATH}"

    # Tag it!
    xcrun git tag ${TAG_VERSION}-${BUILD_NUM_SET}
    git push origin --tags
    TAG_PUSHED=`xcrun git describe --tags --abbrev=0`

    echo "Tagged this commit ${TAG_PUSHED}"