Skip to content

Instantly share code, notes, and snippets.

@rxmichael
Created March 8, 2018 20:59
Show Gist options
  • Save rxmichael/3e64329c60f4308ff630ec837333860a to your computer and use it in GitHub Desktop.
Save rxmichael/3e64329c60f4308ff630ec837333860a to your computer and use it in GitHub Desktop.
Podspec update script
#!/bin/bash
sources="https://github.com/CocoaPods/Specs.git"
podRepo="INSERT YOUR PRIVATE POD REPO HERE"
echo "--------tag list--------"
git tag -l
echo "--------tag list--------"
# Grab pod name
podspecName=$(basename $(find . -name *.podspec) | sed 's/.podspec//g' )
version=$(awk '/\.version/' $podspecName.podspec | awk '/[0-9]\.[0-9]\.[0-9]/' | sed 's/.version//g' | sed 's/[^0-9/.]//g')
echo $podspecName $version
pod lib lint --allow-warnings --sources=$sources
# Pod lint fail
if [ $? != 0 ];then
exit 1
fi
git tag -m "update podspec" $version
git push --tags
pod repo push $podRepo $podspecName.podspec --allow-warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment