申请Cocoapods开源库

申请自己的开源库以及遇到的部分问题:
1.申请流程第一步当然是需要有自己的git仓库。The world’s leading software development platform · GitHub
同时注意在创建的时候由于私有库已经免费,所以开源的就不要选成私有的。

2.将代码传到仓库中,具体就不详细介绍。
3.将仓库的代码clone到本地,注意需要有License文件。

那么假如手残在创建开源库的时候没有选择呢?那么照着图来吧,记得创建好之后需要提交到代码里。


4.接下来:
# 查看所有的tag $ git tag
#删除local一个tag $ git tag -d tagName
# 删除remote tag "1.0.0"$ git push origin :refs/tags/1.0.0
# 删除一个远程的tag$ git push origin –delete tag 《tagName》
# 将v0.1.2标签提交到git服务器
$ git push origin v0.1.2 # 将本地所有标签一次性提交到git服务器
$ git push origin –tags $ git push --tags# push结束以后千万不能忘记打tag!!!而且tag值一定要和s.version保持一致!!!
$ git tag -m "NHBarScrollTool" 0.1.0
git tag"v1.0.0"git tag "1.0.0"
git push --tags
若未注册,需要注册。具体的注册请参考:注册流程
注意点:在这里很多网上教程都是指导tag的写法如上图git tag "v1.0.0",可想而知报错了。

* 解决方案将tag 写成git tag "1.0.0" 问题解决
* 完成之后cd到本地代码仓库。
* pod spec create info 使用命令行之后

然后打开文件按需修改,此处推荐几个介绍详细的文档
5.验证 pod spec lint info.podspec --verbose --use-libraries
pod trunk push info.podspec —allow-warnings 忽略警告push版本
然后

接着如果pod serch info 报错的话 pod setup,
最后大功告成:
