Search code examples
ioscocoapods

How to update pod homepage (readme) on Cocoapods.org website


We have a released pod and I want to update the readme on the pod homepage on Cocoapods. I tried to update the readme parameter in the podspec file to read from a file in the framework zip file but still not reflecting on Cocoapods website.

spec.readme       = 'AATKit/AATKit.xcframework/ios-arm64_armv7/AATKit.framework/README.md'

Does anyone know how to update the pod's homepage on Cocoapods?


Solution

  • Looking at Podspec Reference, it describes the readme entry as “The URL for the README markdown file for this pod version.” In your code sample, you seem to have a repo-relative filepath, not an Internet-accessible URL. (Don't ask me why it works like this, I have disagreed with many of CocoaPods' design decisions over the years.)

    The solution is to just point it to the README.md somewhere publicly accessible on the web. For my pod, I pointed to the raw source of my README at the current version by adding this to my podspec:

    spec.readme = "https://raw.githubusercontent.com/capnslipp/NilCoalescingAssignmentOperators/#{spec.version.to_s}/README.md"
    

    I can't say exactly what the URL format will be for a public BitBucket repo, but it should be something similar. I found this URL on GitHub by clicking on my version tag, then the tag icon to show the whole tree for that version, then clicked on README.md, and finally clicked on the Raw button, copied the URL and replaced the version with #{spec.version.to_s}.