From 372fde45699971cdeb795c525dd83efcfd04b635 Mon Sep 17 00:00:00 2001 From: Harry Chen Date: Wed, 1 May 2024 12:11:41 +0800 Subject: [PATCH] ci: add release build Signed-off-by: Harry Chen --- .github/workflows/example-app.yml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/example-app.yml b/.github/workflows/example-app.yml index e3eaaa5..934ef87 100644 --- a/.github/workflows/example-app.yml +++ b/.github/workflows/example-app.yml @@ -1,22 +1,23 @@ -# This is a basic workflow to help you get started with Actions - name: Build Example App -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch on: [push, pull_request] -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, 'ci skip')" + if: ${{ !contains(github.event.head_commit.message, 'ci skip') }} + + strategy: + fail-fast: false + matrix: + variant: [debug, release] + include: + - variant: debug + artifact-path: build/app/outputs/apk/app-debug.apk + - variant: release + artifact-path: build/app/outputs/flutter-apk/app-release.apk - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: @@ -24,7 +25,8 @@ jobs: java-version: '17' - uses: subosito/flutter-action@v2 with: - channel: 'stable' # or: 'dev' or 'beta' + channel: 'stable' + cache: true - run: dart pub get - run: dart format --output=none --set-exit-if-changed . - run: dart analyze @@ -35,5 +37,5 @@ jobs: working-directory: example/ - uses: actions/upload-artifact@v4 with: - name: example-apk-debug - path: example/build/app/outputs/apk/debug/app-debug.apk + name: example-apk-${{ matrix.variant }} + path: example/${{ matrix.artifact-path }}