1、建仓库

image.png
2、clone 本地 仓库内准备好要发布的内容
查看pod账号
pod trunk me
注册pod账号
pod trunk register xxxxxx@xx.com 'username'
cd到工程README.md位置 创建podspec
pod spec create podspecFileName
编辑podspec
Pod::Spec.new do |spec|
#存储库名称 会自动读取
spec.name = "xxx"
#版本,与Target一致
spec.version = "1.0.0"
#简介
spec.summary = "简介内容"
spec.description = <<-DESC
描述内容
DESC
#主页地址
spec.homepage = "https://github.com/xxx/xxx"
#开源协议
#spec.license = "MIT (example)"
spec.license = { :type => "MIT", :file => "FILE_LICENSE" }
#作者
spec.author = { "438810364@qq.com" => "438810364@qq.com" }
#支持的平台和版本号
spec.platform = :ios, "11.0"
#托管的git路径
spec.source = { :git => "https://github.com/xxx/xxx", :tag => "#{spec.version}" }
#托管的代码路径 从README.md位置开始
spec.source_files = "Classes", "ALHCategory/ALHCategory/ALHCategory/**/*.{h,m}"
#排除
spec.exclude_files = "Classes/Exclude"
#是否支持ARC
spec.requires_arc = true
#依赖的第三方
spec.dependency 'ALHCategory', '~> 1.0.0'
end
3、push工程,新建发布版本,版本号对应
校验podspec文件
pod spec lint
校验并忽略警告
pod spec lint --allow-warnings
发布
pod trunk push --allow-warnings
网友评论