所以背景是这样的:我有一个 Xcode 项目,它依赖于 github 上私有存储库中的 swift 包。当然,这需要密钥才能访问。到目前为止,我已经设法配置 CI,以便我可以 ssh 进入实例和git cloneswift 包所需的存储库。不幸的是,当xcbuild像 CI 一样运行它时,它不起作用,我收到以下消息:
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
Run Code Online (Sandbox Code Playgroud)
相比之下,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: …Run Code Online (Sandbox Code Playgroud)