我正在尝试使用 Github Actions 构建一个 macOS 应用程序。这已经很好地工作了,直到我将我的依赖项迁移到 Swift 包管理器。现在我在构建我的应用程序时收到以下错误:
xcodebuild: error: Could not resolve package dependencies:
The server SSH fingerprint failed to verify.
我有一个私有 GitHub 存储库作为我的应用程序中的依赖项,使用 ssh 位置添加为 Swift 包。因此,我需要在Set up ssh-agent
步骤中为依赖项添加我的 ssh 密钥。使用步骤手动克隆存储库git clone
工作正常,但我需要让它与 xcodebuild 一起使用才能成功构建我的应用程序。
工作流文件
name: Main
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
name: Release
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Set up ssh-agent
uses: yakuhzi/action-ssh-agent@v1
with:
public: ${{ secrets.SSH_PUBLIC_KEY }}
private: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Build application
run: |
sudo xcode-select -switch /Applications/Xcode_11.app
xcodebuild -project Application.xcodeproj -scheme Application -configuration Release -derivedDataPath $HOME/Application build