首页 > 解决方案 > 使用 github 操作自动化颤振工作流程

问题描述

我有一个颤振项目,正在尝试使用 github 操作实现自动化。我想在创建新标签并将 apk 保存到其中后立即创建 apk。有人能帮我吗?

on : push
name: build and test app
jobs:
  build:
    name: install dependencies
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master

    - name: install dependencies
      uses: steebchen/flutter@v1.0.0
      with:
        args: pub get

 #   - name: run tests
  #    uses: steebchen/flutter@v1.0.0
   #   with:
    #    args: test

    - name: build apk
      uses: steebchen/flutter@v1.0.0
      with:
        args: build apk --release

#- uses: actions/checkout@master

    - uses: actions/download-artifact@master
      with:
        name: app-release.apk
        path: build/app/outputs/apk/release/

    - run: cat build/app/outputs/apk/release/

我可以构建它,但我无法下载工件

在此处输入图像描述

标签: githubfluttergithub-actions

解决方案


要使用 --release 必须在 android 上设置密钥存储和signingConfigs。那做完了吗?我已经使用 Actions 和 kind-of-work 设置了应用程序(它失败了,因为应用程序正在使用颤振开发通道并且操作的图像使用稳定)。

首先尝试使用'build apk --debug'

另外,使用 ls 查看目录:

    - run: ls android/build/app/outputs/apk/release/

推荐阅读