-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (58 loc) · 2.21 KB
/
flutter-ci.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
name: Flutter CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Setup Java environment in order to build the Android app.
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "12.x"
# Setup the flutter environment.
- uses: subosito/flutter-action@v1
with:
channel: "stable" # 'dev', 'alpha', default to: 'stable'
# flutter-version: '1.12.x' # you can also specify exact version of flutter
- name: Get Flutter packages
run: flutter pub get
- name: Run build_runner
run: flutter pub run build_runner build --delete-conflicting-outputs
# - name: Check formatting issues
# run: flutter format --set-exit-if-changed .
- name: Decode secrets
if: ${{ !env.ACT }}
env:
SECRETS_PROPERTIES: ${{ secrets.SECRETS_PROPERTIES }}
SECRETS_DART: ${{ secrets.SECRETS_DART }}
KEY_PROPERTIES: ${{ secrets.KEY_PROPERTIES }}
KEYSTORE_B64: ${{ secrets.KEYSTORE_B64 }}
run: |
echo $SECRETS_PROPERTIES > ./android/secrets.properties
echo $KEY_PROPERTIES > ./android/key.properties
mkdir -p ./lib/constants
echo $SECRETS_DART > lib/constants/secrets.dart
sudo mkdir -p /home/owner
echo $KEYSTORE_B64 > /home/owner/upload-keystore.jks.b64
base64 -d -i /home/owner/upload-keystore.jks.b64 > /home/owner/upload-keystore.jks
- name: Analyze dart code for errors
run: flutter analyze .
# - name: Run tests
# run: flutter test
- name: Build Android apk
run: flutter build apk --split-per-abi
- name: Rename Release
run: mv app-armeabi-v7a-release.apk app-release-${{ github.run_number }}.apk
working-directory: build/app/outputs/flutter-apk
- uses: actions/upload-artifact@v2
with:
# Name of the command/step.
name: release-apk-${{ github.run_number }}
# Path to the release apk.
path: build/app/outputs/flutter-apk/app-release-${{ github.run_number }}.apk
retention-days: 7