-
Notifications
You must be signed in to change notification settings - Fork 6
CocoaPods
This page documents the steps required to get your iOS artifact into CocoaPods and CocoaDocs.
The guide to deploying a library and adding additional contributors is here
Sign up for an account and validate email address:
pod trunk register [email]@[address].com 'Your Name' --description='MacBook Pro'
Important note is that you can upload a unique version of a library once. You can not update the same version of a library. You must increase the version number to upload again.
It is recommended to run lint on your podspec before deploying to work out any problems:
Locally:
pod lib lint [name].podspec pod lib lint [name].podspec --verbose pod lib lint [name].podspec --verbose --allow-warnings pod lib lint [name].podspec --verbose --use-libraries --allow-warnings
From released version:
pod spec lint [name].podspec pod spec lint [name].podspec --verbose pod spec lint [name].podspec --verbose --allow-warnings pod spec lint [name].podspec --verbose --use-libraries --allow-warnings
Deploy to trunk:
pod trunk push [name].podspec
or if you have warnings that are OK:
pod trunk push [name].podspec --allow-warnings
or if you need to use static libraries:
pod trunk push [name].podspec --use-libraries --allow-warnings
Add another owner / contributor:
pod trunk add-owner [pod name] [email]@[address].com
See pod info including owners:
pod trunk info [pod name]
List your sessions and pods:
pod trunk me
Remove a contributor:
pod trunk remove-owner [pod name] [email]@[address].com
CocoaPods and CocoaDocs seem to take their time to process and update things. Sometimes they resolve themselves, sometimes there are problems in your podspec that stop the process, and sometimes you have to request they try again.
This blog post helps a lot in figuring out what is going wrong.
Validate your CocoaDocs appear here and were successful:
http://cocoadocs.org/docsets/[pod]/
Ask CocoaDocs to take another look at your pod:
http://api.cocoadocs.org:4567/redeploy/[pod]/latest
Check for reported errors:
http://api.cocoadocs.org:4567/error/[pod]/[Version]
Check if the metrics are being reported here:
http://metrics.cocoapods.org/api/v1/pods/[pod]
Check if your pod has a page here:
http://cocoapods.org/pods/[pod]
Previewing CocoaDocs locally can help to diagnose problems generating docs.
After you have cocoadocs.org cloned and set up:
bundle exec ./cocoadocs.rb preview [pod] [branch] --verbose
If you want to manually change the podspec and skip retrieving the cocoapods trunk version -
Change your podspec here:
./cocoadocs.org/activity/cocoadocs_specs/Specs/[pod]/[version]/[pod].podspec.json
And run by skipping fetch specs:
bundle exec ./cocoadocs.rb preview [pod] [branch] --verbose --skip-fetch-specs
Recommended steps for releasing an iOS CocoaPods repository
- Update any dependencies needed in
Podfile
and<name>.podspec
- Update
CHANGELOG.md
with release version, URL, date, and changes made - Update
README.md
with new release version - Clean the project
rm -rf Pods/
rm -rf <name>.xcworkspace/
rm Podfile.lock
- Build the project
pod repo update
pod install
- Open the project
open <name>.xcworkspace/
- Verify the project builds with acceptable warnings and run the tests
- Most projects have a
docs/release.txt
file with the following build, test, and release commands - Verify Xcode command build and tests
xcodebuild -workspace '<name>.xcworkspace' -scheme <name> build
xcodebuild test -workspace '<name>.xcworkspace' -scheme <name> -destination 'platform=iOS Simulator,name=iPhone 15'
- Local Lint
- Objective-C:
pod lib lint <name>.podspec
- Swift:
pod lib lint <name>.podspec --swift-version=5 [--use-static-frameworks]
- Objective-C:
- Update the doc
- Remove the existing documentation at
docs/docs/api
- Update with the new release version and copy the documentation command
- Objective-C:
docs/jazzy.txt
- Swift:
docs/swift-doc.txt
- Objective-C:
- Run the command from the top level project directory
- Remove the existing documentation at
- Commit all changes to sub branch (such as
develop
) - Verify GitHub Actions workflows pass for sub branch
- Merge sub branch to
master
branch - Verify GitHub Actions workflows pass for
master
branch - Create a new GitHub release for the version using previous versions as a template
- Release Lint
- Objective-C:
pod spec lint <name>.podspec
- Swift:
pod spec lint <name>.podspec --swift-version=5 [--use-static-frameworks]
- Objective-C:
- Publish the library
- Objective-C:
pod trunk push <name>.podspec
- Swift:
pod trunk push <name>.podspec --swift-version=5
- Objective-C:
- Set up the next version
- Update the
<name>.podspec
next version - Add the next version to
CHANGELOG.md
- Commit to
master
- Merge
master
down to development branch such asdevelop
- Update the