1.登錄https://github.com/,隨便見一個(gè)倉(cāng)庫(kù)
2.復(fù)制倉(cāng)庫(kù)地址店溢,建議Sourcetree克隆到本地,方便提交
3.找到一個(gè)*****.podspec文件溉卓,可以先pod本地文件铜异,驗(yàn)證podspec的正確
Pod::Spec.new do |s|
s.name = "DMCMNLabel"
s.version = '2.0.0'
s.summary = "測(cè)試"
s.description = <<-DESC
測(cè)試
DESC
s.homepage = "https://github.com/***/test"
s.license = "MIT"
s.author = { "dmc" => "809***875@qq.com" }
s.platform = :ios, "9.0"
s.ios.deployment_target = "9.0"
s.source = { :git => "https://github.com/***/test", :tag => "#{s.version}" }
s.frameworks = "UIKit", "Foundation"
s.requires_arc = true
s.static_framework = true
#s.dependency 'SDWebImage'
#s.dependency 'AFNetworking'
#s.dependency 'XhlNetWorking/API'
s.source_files = "DMCMNLabel/**/*.{h,m}"
end
1.版本要跟xxx.podspec一致, cd到當(dāng)前目錄
git tag -a 0.0.1 -m "version 0.0.1"
git push origin 0.0.1
2.驗(yàn)證源代碼與xxx.podspec文件配置是否正確(xxx不能重復(fù)),第一次需要庶喜,后續(xù)更新省略此步驟
pod spec lint xxx.podspec
3.提交spec到Specs倉(cāng)庫(kù)
pod lib lint xxx.podspec --allow-warnings --use-libraries
4.將.podspec文件提交到gitHub上
pod trunk push
pod trunk push --allow-warnings//報(bào)錯(cuò)可以用這句
首次需要登錄小腊,點(diǎn)擊郵件驗(yàn)證即可
pod trunk register xxx@example.com 'nikename'
私有pod
pod 'xxx', :path => '~/本地路徑'
pod 'xxx', :podspec => 'https://github.com/AssassinsDevilMayCry/test/xxx.podspec'
//修改源頭
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/AssassinsDevilMayCry/test/xxx.podspec'