-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbump_version.sh
More file actions
executable file
·27 lines (21 loc) · 846 Bytes
/
bump_version.sh
File metadata and controls
executable file
·27 lines (21 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash -e
VERSION=$1
PODSPEC_FILENAME="PTTimer.podspec"
if [ -z $VERSION ]; then
echo "new version should be supplied at the first argument"
current=$(egrep "\.version\s+=" ${PODSPEC_FILENAME} | awk -F= '{print $2}')
echo "(current version is $current)"
exit 1
fi
sed -E -i '' "s/(.*\.version[[:space:]]*=[[:space:]]*).*/\1\"${VERSION}\"/g" ${PODSPEC_FILENAME}
echo "Updating ExampleTimer Podfile"
(cd ExampleTimer && pod install && git add Podfile* && git commit -m "Update ExampleTimer to pod ${VERSION}")
echo "Committing and pushing version ${VERSION}"
git add ${PODSPEC_FILENAME}
git commit -m "Update podspec to ${VERSION}"
git tag -a $VERSION -m "Update podspec to ${VERSION}"
git push && git push origin $VERSION
echo "Linting podspec"
pod spec lint ${PODSPEC_FILENAME}
echo "Pushing to Cocoapods trunk"
pod trunk push