更改Podspec上的仓库的正确方法是什么?

时间:2019-07-29 20:07:47

标签: frameworks cocoapods

我从个人仓库创建了第一个cocoapod,并通过pod trunk push命令将其部署到cocoapods。因为这是我的第一个框架,所以我想在个人回购中开发它,以使我的混乱提交保密。现在产品已经准备就绪,我需要将工作迁移到开放源代码存储库,并更新cocoapod的源代码。

我尝试更改podspec的s.homepage和s.source行,但是出现此fatal: Remote branch 1.0.0 not found in upstream origin错误。

Updating spec repo `master`
Validating podspec
 -> EvolvKit (1.0.0)
    - ERROR | [iOS] unknown: Encountered an unknown error ([!] /usr/bin/git clone https://github.com/evolv-ai/EvolvKit.git /var/folders/jb/xlkpf4sn6fl9wtsh3g7pkqrh0000gp/T/d20190729-87754-7w53ir --template= --single-branch --depth 1 --branch 1.0.0

Cloning into '/var/folders/jb/xlkpf4sn6fl9wtsh3g7pkqrh0000gp/T/d20190729-87754-7w53ir'...
warning: Could not find remote branch 1.0.0 to clone.
fatal: Remote branch 1.0.0 not found in upstream origin
) during validation.

[!] The spec did not pass validation, due to 1 error and 1 warning.
➜  EvolvKit git:(master)

旧豆荚规格:

Pod::Spec.new do |s|

# more configs
  s.homepage         = 'https://github.com/<personal_repo>/EvolvKit'
  s.license          = { :type => 'APACHE', :file => 'LICENSE' }
  s.author           = { 'PhyllisWong' => 'phyllis.wong@evolv.ai' }
  s.source           = { :git => 'https://github.com/<personal_repo>/EvolvKit.git', :tag => s.version.to_s }

# more configs
end

新的podspec行已更改:

  s.homepage         = 'https://github.com/<opensource_repo>/EvolvKit'
  s.source           = { :git => 'https://github.com/<opensource_repo>/EvolvKit.git', :tag => s.version.to_s }

我尝试过的一些事情是:

0. update git tag with version 1.0.0
1. updating the urls in the pod spec
2. clone the repo into a new directory, create a new git repo, and follow steps to trunk push
3. deleting the pod (was only able to delete versions) ...no one is using this pod btw.
4. considered changing the pod name, but that is less than ideal

任何关于前进道路的想法都将受到赞赏。

编辑

结果是我缺少使用git标签更新我的仓库的步骤。需要推送标签。

1 个答案:

答案 0 :(得分:1)

基于我上面关于标记分支的注释,您也git push --tags吗?应用标签是一个两步过程,如果没有这两个步骤,则可能会遇到上述错误。

enter image description here

相关问题