使用CocoaPods上传自己的框架到GitHub

简述一下使用CocoaPods上传自己的框架到GitHub步骤:
中间的坑,看了我这篇文章你就解决了.其他详细步骤可以参考官网地址:
https://cocoapods.org/

  1. cd /Volumes/soft/GitHubRepo/ZHCocoa
  2. git tag -a 1.0 -m "v1.0"

版本号tag要与podspec文件中version对应上

  1. SourceTree推送到远端仓库
  2. pod spec create ZHCocoa
ZHCocoa.podspec文件描述
s.name         = "ZHCocoa"
s.version      = "1.0"
s.summary      = "Dictionary for Model."
s.description  = <<-DESC
                 An easy tool to use dictionary for model
                 DESC
s.homepage     = "https://github.com/zhonghphuan/ZHCocoa"
s.license      = "MIT"
s.author             = { "zhonghuan" => "[email protected]" }
s.source       = { :git => "https://github.com/zhonghphuan/ZHCocoa.git", :tag => s.version.to_s}
s.source_files = "ZHCocoa", "ZHCocoa/**/*.{h,m}"
  1. SourceTree推送到远端仓库
  2. pod spec lint ZHCocoa.podspec
    很多人这个地方出错:

出现报错: The source_files pattern did not match any file.解决方案:
进入:open /Users/HM/Library/Caches/CocoaPods/Pods/External/ZHCocoa/03ca67e69ca3e1263e0aa65655a1cab6-2bcdd
发现没有任何东西,然后我们将要要上传的框架文件夹直接拖进去就可以了

7 . 进入~/.cocoapods/repos/master/Specs可以看到自己的框架文件了.提交到远端供其他人使用方法.
8 . pod trunk register [email protected] ‘xxxx' --verbose
9 . pod trunk push ZHCocoa.podspec
10 . pod search ZHCocoa

你可能感兴趣的:(使用CocoaPods上传自己的框架到GitHub)