I am trying to build a macOS app with Github Actions. This already worked very well, until I migrated my dependencies to Swift Package Manager. Now I am getting the following error while building my app:
xcodebuild: error: Could not resolve package dependencies:
The server SSH fingerprint failed to verify.
I have a private GitHub repository as a dependeny in my application added as a Swift Package using a ssh location. Therefore I need to add my ssh key for the dependency in the Set up ssh-agent
step. Manually cloning the repository in a step using git clone
is working fine but I need to get it work with xcodebuild in order to successfully build my app.
Workflow file
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