Skip to content

Instantly share code, notes, and snippets.

@kardolus
Last active September 28, 2018 00:04
Show Gist options
  • Select an option

  • Save kardolus/35036edb53197ed569348eab09018fea to your computer and use it in GitHub Desktop.

Select an option

Save kardolus/35036edb53197ed569348eab09018fea to your computer and use it in GitHub Desktop.
if [ "$#" -ne 2 ]; then
echo "Usage: bump_version <version_number> <message>"
exit 1
fi
VERSION=$1
MESSAGE=$2
# Update package.json
sed -i '' "s/\"version\": \"[[:digit:]]*.[[:digit:]]*.[[:digit:]]*\"/\"version\": \"${VERSION}\"/g" package.json
# Update XCode version and build
sed -i '' "/<key>CFBundleShortVersionString<\/key>/,/<key>CFBundleSignature<\/key>/s/<string>[[:digit:]]*.[[:digit:]]*.[[:digit:]]*<\/string>/<string>${VERSION}<\/string>/g" ios/verne/Info.plist
sed -i '' "/<key>CFBundleVersion<\/key>/,/<key>LSRequiresIPhoneOS<\/key>/s/<string>[[:digit:]]*<\/string>/<string>1<\/string>/g" ios/verne/Info.plist
# Push App to TestFlight
pushd ios
fastlane beta
popd
# Commit to git
git add .
git commit -m "Bump Verne Version"
git push
# Create git tag
git tag -a v$VERSION -m "${MESSAGE}"
git push origin v$VERSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment