我有 iOS 应用程序的 swift 包(它需要 UIKit
才能运行)。我不想使用 Github 操作构建这个包,这就是我的工作流程
name: Swift
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: YOCKOW/Action-setup-swift@master
with:
swift-version: '5.3'
- name: Build
run: swift build -v
- name: Run tests
run: swift test -v
当我运行这个构建时,我得到了error: no such module 'UIKit'
。
所以我有两个选择:
让我的包 UIKit 独立(实际上不知道怎么做)
配置构建以专门在 iOS 上运行
我该怎么办?
最佳答案
我们使用 xcodebuild
而不是 swift build
从 GitHub Actions 执行平台特定的 CI。请参阅 https://github.com/firebase/firebase-ios-sdk/blob/master/.github/workflows/spm.yml 中的具体示例和 https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/build.sh#L540
关于swift - 专门使用 Github 操作为 iOS 构建 swift 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64378044/