【发布时间】:2020-03-20 23:06:46
【问题描述】:
所以背景是这样的:我有一个 Xcode 项目,它依赖于一个 swift 包,该包位于 github 上的私有存储库中。当然,这需要密钥才能访问。到目前为止,我已经设法配置 CI,以便我可以通过 ssh 进入实例并git clone swift 包所需的存储库。不幸的是,当 CI 使用 xcbuild 运行它时,它不起作用,我收到以下消息:
static:ios distiller$ xcodebuild -showBuildSettings -workspace ./Project.xcworkspace \
-scheme App\ Prod
Resolve Package Graph
Fetching git@github.com:company-uk/ProjectDependency.git
xcodebuild: error: Could not resolve package dependencies:
Authentication failed because the credentials were rejected
相比之下,git clone 会很高兴地获取这个 repo,如下所示:
static:ios distiller$ git clone git@github.com:company-uk/ProjectDependency.git
Cloning into 'ProjectDependency'...
Warning: Permanently added the RSA host key for IP address '11.22.33.44' to the list of known hosts.
remote: Enumerating objects: 263, done.
remote: Counting objects: 100% (263/263), done.
remote: Compressing objects: 100% (171/171), done.
remote: Total 1335 (delta 165), reused 174 (delta 86), pack-reused 1072
Receiving objects: 100% (1335/1335), 1.11 MiB | 5.67 MiB/s, done.
Resolving deltas: 100% (681/681), done.
关于更多上下文,这是在 CircleCI 上运行的,在 GitHub 上使用 Deploy 密钥设置,该密钥已添加到 CI 上的 Job。
任何关于 Xcode 尝试获取依赖项的方式和 vanilla git 的方式之间可能有什么不同的建议都会很棒。谢谢。
【问题讨论】:
-
我目前在 GitHub Actions 上遇到与我的 CI 相同的问题
-
不是一个答案,但有时在过去(尤其是 Xcode 10),git 身份验证详细信息有无缘无故消失的趋势(在启动时正常,然后噗)。 Xcode 11 解决了这个问题。
标签: swift xcode git circleci swift-package-manager