iOS|iOS Cocoapods发布笔记

前提 【iOS|iOS Cocoapods发布笔记】项目已提交到远程仓库,比如 github.
发布 进入项目目录:
1.创建以 项目名为前缀的.podspec文件
pod spec create JHFrameLayout
2.修改JHFrameLayout.podspec文件内容
在创建好的模板文件上进行修改:
更多参数请求参见模板。

Pod::Spec.new do |s| s.name= 'JHFrameLayout' s.summary= 'A simple methods for frame layout.' s.version= '1.0.1' s.license= { :type => 'MIT'} s.authors= { 'Haocold' => 'xjh093@126.com' } s.homepage= 'https://github.com/xjh093/JHFrameLayout' s.source= { :git => 'https://github.com/xjh093/JHFrameLayout.git', :tag => s.version} s.source_files = 'JHFrameLayout/*.{h,m}' s.requires_arc = true s.framework= 'UIKit' s.ios.deployment_target = '6.0' #s.frameworks= 'UIKit','Foundation' #s.dependency "YYModel", "~> 1.0.4" #s.dependency "AFNetworking" end

3.添加 git add .
3.提交 git commit -m "添加 .podspec 文件"
4.推送 git push origin
5.打tag git tag 1.0.0
6.推送tag git push --tags
7.推送JHFrameLayout.podspec 文件 pod trunk push --allow-warnings
执行此步,前提是已经注册了trunk 账号
注册:pod trunk register 邮箱地址 'Your Name'
执行此步前,省略了验证 pod spec lint JHFrameLayout.podspec
8.成功
CongratsJHFrameLayout (1.0.0) successfully published March 9th, 00:01 https://cocoapods.org/pods/JHFrameLayout Tell your friends!

参考:
如何发布自己的开源框架到CocoaPods

    推荐阅读