3

我按照教程设置了一个 Github Action,用于通过 Testflight 自动构建和部署 iOS 应用程序。如果我在本地使用 testlane,一切都会按预期工作,并且应用程序会发送到 TestFlight。但是在 Github Actions 上,构建成功但是当我需要将应用程序上传到 Appstore Connect 时,我收到错误:

错误:没有找到匹配“匹配 AppStore com.XXX.XXX”的团队“XXX”的配置文件:Xcode 找不到任何匹配“XXX/匹配 AppStore com.XXX.XXX”的配置文件

我已正确添加了所需的每个秘密,但由于某种原因,fastlane 匹配无法找到我的配置文件和我的签名证书。任何帮助将不胜感激。我在下面添加了我的 yaml 配置:

name: Build Flutter for iOS
# This workflow is triggered on pushes to the repository.
on: [push]
  # workflow_dispatch:

env:
    flutter_version: '1.22.1'
    java_version: '12.x'
    gcloud_version: '290.0.1'

jobs:
  build:
    name: Build 
    runs-on: macos-latest
    steps:
      # ===== APPSTORE SIGNING BUILD====#
      - uses: actions/checkout@v2

      - name: Select Xcode version
        run: sudo xcode-select -s '/Applications/Xcode_11.3.app/Contents/Developer'
      - name: Bundle install
        run: cd ./ios && bundle install
      # ==== SETUP FLUTTER
      - name: Setup JDK
        uses: actions/setup-java@v1
        with:
          java-version: ${{ env.java_version }}
      # https://github.com/subosito/flutter-action/issues/16
      - uses: actions/cache@v2
        with:
          path: /opt/hostedtoolcache/flutter
          key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }}
      - uses: subosito/flutter-action@v1.4.0
        with:
          flutter-version: ${{ env.flutter_version }}
          channel: 'stable'
      - name: Install tools
        run: |
            flutter pub get
            cd ./ios && pod install
      - name: Setup SSH Keys and known_hosts for fastlane match
        run: |
            SSH_PATH="$HOME/.ssh"
            mkdir -p "$SSH_PATH"
            touch "$SSH_PATH/known_hosts"
            echo "$PRIVATE_KEY" > "$SSH_PATH/id_rsa"
            chmod 700 "$SSH_PATH"
            ssh-keyscan github.com >> ~/.ssh/known_hosts
            chmod 600 "$SSH_PATH/known_hosts"
            chmod 600 "$SSH_PATH/id_rsa"
            eval $(ssh-agent)
            ssh-add "$SSH_PATH/id_rsa"
        env:
          PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
      - name: Deploy to TestFlight
        run: |
            cd ./ios && bundle exec fastlane beta
        env:
            TEAM_ID: ${{ secrets.TEAM_ID }}
            ITC_TEAM_ID: ${{ secrets.ITC_TEAM_ID }}
            FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
            FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
            FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}
            FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }}
            MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
            MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }}
            MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }}

这是我的快速文件:

 platform :ios do
  desc "Push a new beta build to TestFlight"
  lane :beta do
    build_app(workspace: "Runner.xcworkspace", scheme: "Runner")
    upload_to_testflight
    if is_ci
        create_keychain(
          name: ENV['MATCH_KEYCHAIN_NAME'],
          password: ENV["MATCH_KEYCHAIN_PASSWORD"],
          default_keychain: true,
          unlock: true,
          timeout: 3600,
          lock_when_sleeps: false
        )
    end
    match(
        type: "appstore",
        readonly: is_ci,
        keychain_name: ENV['MATCH_KEYCHAIN_NAME'],
        keychain_password: ENV["MATCH_KEYCHAIN_PASSWORD"],
    )
    build_app(
      workspace: "Runner.xcworkspace",
      scheme: "Runner",
      export_method: "development"
    )
    upload_to_testflight
  end
end
4

0 回答 0