ios CI/CD 持续集成 组件化专题四-(手动发布私有库-组件化搭建)

一 、创建私有索引库

1.1 、第一步

首先检查本地是否存在需要的私有索引库

pod repo list

例如:dp_base_ios_spec 在本地不存在该私有索引库

1.2 、第二步

在git下下创建一个新的库,这个库用来保存私有库的podspec文件,取名叫xxxSpec用以区分这个库的作用,如下base_ios_spec索引库

1.3 、第三步

接着创建本地索引库,也就是将刚才创建的远程索引库dp_base_ios_spec关联到本地

pod repo add base_ios_spec git@git.xxx/base_ios_spec.git

此时本地就有了 base_ios_spec这个索引库

二 、开始创建本地私有库

2.1 第一步

首先创建本地私有库(该库是代码库)

pod lib create DPApplePurchasing

2.2 第二步

按照提示输入相应的配置

2.3 、第三步

配置完成后会自动打开一个xcode工程,具体层级如下图

2.4 、第四步

在CommonUtil里面放入自己的私有库代码同时删除掉ReplaceMe

2.5 、第五步

到demo中进行

pod install

2.6 、第六步

然后编写podspec文件,详情见以下

三 、 将私有库push到远程仓库

3.1 、Push an existing folder

复制代码
cd existing_folder
git init
git remote add origin git@xxx/dpalipaymodule.git
git add .
git commit -m "Initial commit"

3.2 、Push an existing Git repository

复制代码
cd existing_repo
git remote rename origin old-origin
git remote add origin git@xxx/dpalipaymodule.git

3.4 拉取远程内容

git pull --rebase origin master 拉取远程仓库的内容和本地的合并

git push -u origin master 将代码推送到远程仓库的master分支

四 、进行本地校验

4.1 、pod lib lint --allow-warnings

组组件依赖了三方QKYYKit,需要添加三方库的git地址

4.2 、 修改本地校验添加三方库的cocoapods地址

pod lib lint --sources="https://github.com/CocoaPods/Specs.git" --use-libraries --allow-warnings --no-clean

出现上述提示,代表本地校验成功

五 、进行远程校验

pod spec lint --sources="https://github.com/CocoaPods/Specs.git" --use-libraries --allow-warnings

出现以上错误信息,表示需要先打tag才能进行远程校验

执行完第六步再次执行上面的远程校验显示如下,代表远程校验通过

六 、打tag

七 、接着需要把podspec推送到远程私有索引库

pod repo push dp_base_ios_spec CommonUtil.podspec --verbose --use-libraries --allow-warnings

上传成功后在远程和本地索引库显示如上

八 、 验证私有库是否发布成功

到此手动发布私有库CommonUtil 成功,就可以正常使用

相关推荐
茶底世界之下5 小时前
斜光下的旧自行车:用 Awaking 留一版复古胶片色
ios·app·产品
2501_916008899 小时前
iPhone 设备信息查看,用 KeyMob 看型号、序列号、电池健康和 UDID
android·ios·小程序·https·uni-app·iphone·webview
十二同学啊9 小时前
Go 工程化详解:项目结构、代码规范、测试体系与 CI/CD 实践
ci/cd·golang·代码规范
Sakura_j_h_1 天前
GitHub Actions 打包 Windows exe:中文编码与产物上传
windows·ci/cd·打包发布·github·pyinstaller·github actions
茶底世界之下1 天前
iPhone Duo 适配实战,Awaking 踩过的 8 个坑
ios·swiftui·swift
跨境数据猎手1 天前
HTTP 响应体编码与压缩:识别、解码
网络协议·http·ios
也非非也1 天前
iPhone 中国区 AI 落地:Apple 与阿里千问合作的技术观察
大数据·人工智能·ios·agent·iphone·智子
砚底藏山河1 天前
量化回测可复现流水线CI化
java·python·ci/cd·金融
茶底世界之下1 天前
同一片泳池,清透还是奶油胶片?用 Awaking 做两版成片
ios
X1A0RAN1 天前
Jenkins CI 流水线优化实践:基于提交指纹的任务缓存
缓存·ci/cd·jenkins