1.先把自己的源码clone下来并先打上tag
git tag -a version1.0 -m 'first version'
git push origin --tags
$ git tag -d 1.2 //删除本地tag
$ git push origin :refs/tags/1.2 // 删除远程库tag
2.创建spec
pod spec create JQProgressHUD
JQProgressHUD.spec的内容如下
Pod::Spec.new do |s|
s.name = 'JQProgressHUD'
s.version = '0.0.4'
s.license = 'Apache License 2.0'
s.summary = 'HUD in Swift'
s.homepage = 'https://github.com/JQHee/JQProgressHUD'
s.authors = { 'JQHee' => '122011059@qq.com' }
s.source = { :git => 'https://github.com/JQHee/JQProgressHUD.git', :tag => s.version }
s.ios.deployment_target = '9.0'
# s.osx.deployment_target = '10.12.5'
s.frameworks = "UIKit", "Foundation"
s.source_files = 'JQProgressHUD/JQProgressHUD/**/*.swift'
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3.0' }
end
3.检查
pod lib lint // 本地,不会检查tag
pod spec lint // 远程
或者
pod lib lint ./JQProgressHUD.spec
4.检查通过后trunk push
pod trunk push
或者
pod trunk push ./JQProgressHUD.spec
5.查看是否已经注册
pod trunk me
// 注册
pod trunk register 122011059@qq.com "JQHee"