首页 > 解决方案 > Flutter IOS - 在 Github Actions 上归档 IOS 包

问题描述

我正在尝试在 Github 操作上导出 Flutter 应用程序的 IOS 存档。所以我做了一个看起来像这样的工作流程:

jobs:
  deploy:
    name: Deploying to Testflight
    runs-on: macOS-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v1
      - name: Fetch flutter dependencies
        run: flutter pub get
      - name: Force Xcode 11
        run: sudo xcode-select -switch /Applications/Xcode_11.4.app
      - name: installing pods
        run: (cd ios && pod install)
      - name: Archiving project
        env:
          PR_NUMBER: $(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
        run: ./.github/scripts/archive_app.sh
      - name: Exporting .ipa
        run: ./.github/scripts/export_ipa.sh

的内容archive_app.sh是:

set -eo pipefail


xcodebuild -workspace $PWD/ios/Runner.xcworkspace \
-scheme productionMyApp \
-archivePath $PWD/build/Runner.xcarchive \
-configuration Release-productionMyApp \
archive | xcpretty

如果我在本地运行此脚本,则该命令将运行完成而没有任何问题。如果我在 Github Actions 上运行它,我会在编译和构建依赖项的过程中遇到错误:

....
▸ Compiling Pods-Runner-dummy.m
▸ Compiling Pods_Runner_vers.c
▸ Compiling Pods-Runner-dummy.m
▸ Compiling Pods_Runner_vers.c
▸ Touching Pods_Runner.framework
▸ Building Runner/Runner [Release-productionMyApp]
▸ Check Dependencies
** ARCHIVE FAILED **


The following build commands failed:
    Check dependencies
(1 failure)
##[error]Process completed with exit code 65.

我的项目的 xcode 兼容性是 11.4。

标签: iosxcodefluttercontinuous-integrationgithub-actions

解决方案


推荐阅读