This repository has been archived by the owner on Jun 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
58 lines (50 loc) · 1.63 KB
/
flutter_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# This is a basic workflow to help you get started with Actions
name: Flutter Build
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, flutter-build-apk ]
paths-ignore:
- '**/*.md'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allows this workflow to be called from other workflows
workflow_call:
inputs:
artifactName:
description: "Name of the uploaded artifact"
required: true
type: string
# 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
env: # For signing the APK
KEY_JKS: ${{ secrets.KEY_JKS }}
KEY_PATH: /home/runner/key.jks
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_ALIAS: key
ARTIFACT_NAME: ${{ inputs.artifactName || 'release-apk' }}
steps:
- uses: actions/checkout@v2
- name: Create key file
run: echo $KEY_JKS | base64 -di > $KEY_PATH
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.3.9'
- run: flutter pub get
- run: flutter pub run build_runner build
- run: flutter build apk --split-per-abi
- name: Archive artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ env.ARTIFACT_NAME }}
path: |
build/app/outputs/apk/*