-
Notifications
You must be signed in to change notification settings - Fork 8
/
action.yml
77 lines (70 loc) · 2.21 KB
/
action.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: flutter-build-android
description: Builds an apk or appbundle
branding:
icon: box
color: green
inputs:
working-directory:
description: The root directory of the flutter app within this repository
default: ./
build-cmd:
description: The full build command, can be used to add arguments
default: flutter build apk --release
keystore-base64:
description: "keystore with which to sign the app"
required: true
keystore-password:
description: "The password for the playstore key used to sign the app"
required: true
runs:
using: "composite"
steps:
- name: Check java found
id: check_java
shell: bash
run: |
if java --version; then
echo "installed=true" >> "$GITHUB_OUTPUT"
else
echo "installed=false" >> "$GITHUB_OUTPUT"
fi
- name: Install java
if: steps.check_java.outputs.installed == 'false'
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "17.x"
cache: "gradle"
- name: Check flutter found
id: check_flutter
shell: bash
run: |
if flutter --version; then
echo "installed=true" >> "$GITHUB_OUTPUT"
else
echo "installed=false" >> "$GITHUB_OUTPUT"
fi
- name: Setup flutter
if: steps.check_flutter.outputs.installed == 'false'
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- run: flutter --version
shell: bash
- name: Decode keystore and create jks and properties file for signing the app
shell: bash
run: |
echo "$KEYSTORE" | base64 --decode > app/keystore.jks
echo "storeFile=keystore.jks" >> key.properties
echo "keyAlias=upload" >> key.properties
echo "storePassword=$KEYSTORE_PASSWORD" >> key.properties
echo "keyPassword=$KEYSTORE_PASSWORD" >> key.properties
env:
KEYSTORE: ${{ inputs.keystore-base64 }}
KEYSTORE_PASSWORD: ${{ inputs.keystore-password }}
working-directory: ${{ inputs.working-directory }}/android
- name: Build
run: ${{ inputs.build-cmd }}
shell: bash
working-directory: ${{ inputs.working-directory }}