【问题标题】:When uploading apk with the Run wzieba/Firebase-Distribution-Github-Action@v1.3.2 I get the following error使用 Run wzieba/Firebase-Distribution-Github-Action@v1.3.2 上传 apk 时出现以下错误
【发布时间】:2021-12-16 16:33:12
【问题描述】:

我正在尝试使用 github 操作将 apk 上传到 firebase。 我已经注释掉了代码分析和测试,以使操作运行得更快,从而尝试解决问题。我也尝试上传一个应用程序包,我得到了相同的响应。 这是github操作配置。

name: Deploy app bundle to firebase

on:
  push:
    branches:
      - dev

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v1
        with:
          java-version: '12.x'
      - uses: subosito/flutter-action@v1 # Setup flutter environment
        with:
          flutter-version: '2.5.0'

      - run: flutter pub get
      - run: flutter pub run build_runner build --delete-conflicting-outputs
      - name: Create env file
        run: |
          cat << EOF > .env
          STAGING_API_BASE_URL="${{ secrets.STAGING_API_BASE_URL }}"
          PROD_API_BASE_URL="${{ secrets.PROD_API_BASE_URL }}"
          BASE_PATH="${{ secrets.BASE_PATH }}"
          EOF
      #      - run: flutter format --set-exit-if-changed #       - run: flutter format --set-exit-if-changed .
      #- run: flutter analyze # Analyze the project's Dart code. This causes job to exit
      #- name: Run flutter analyze
      #  run: |
      #    chmod +x ./flutter_analyze.sh
      #    ./flutter_analyze.sh
      #- run: flutter test # Run Flutter unit tests for the current project.
      - name: Build Gradle
        run: flutter build apk --debug
      - uses: actions/checkout@v2 #This uploads artifacts from your workflow
        with:
          name: debug-apk
          path: build/app/outputs/flutter-apk/app-debug.apk
      - run: ls build/app/outputs/flutter-apk
      - name: Upload artifact to Firebase App Distribution
        uses: wzieba/Firebase-Distribution-Github-Action@v1.3.2
        with:
          appId: ${{secrets.FIREBASE_APP_ID}}
          token: ${{secrets.FIREBASE_TOKEN}}
          groups: testers
          file: build/app/outputs/flutter-apk/app-debug.apk  

当我运行工作流时,我收到以下错误:

【问题讨论】:

    标签: android firebase flutter github-actions firebase-app-distribution


    【解决方案1】:

    您可以使用此脚本查找您构建的 apk 路径:

    run: |
      echo "Find build artifacts"
    
      apkPath=$(find app -name "*.apk" | head -1)
      echo "Found apk at $apkPath"
      
      if [[ -z ${apkPath} ]]
      then
          echo "No apks were found, skip publishing to App Distribution"
      else
          echo "Publishing $apkPath to App Center"
          #publish your apk by using $apkPath
      fi
    

    它会扫描所有代理文件并找到 apk 文件。

    【讨论】:

      【解决方案2】:

      我在这行写错了

      - uses: actions/checkout@v2 #This uploads artifacts from your workflow
      

      评论是正确的,但操作是错误的。 我应该用actions/upload-artifacthttps://github.com/wzieba/Firebase-Distribution-Github-Action/issues/51

      【讨论】:

        猜你喜欢
        • 2020-02-01
        • 1970-01-01
        • 1970-01-01
        • 2021-09-06
        • 2016-02-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-05-03
        相关资源
        最近更新 更多