-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathflutter_project_codecheck_android.yml
More file actions
82 lines (66 loc) · 2.65 KB
/
flutter_project_codecheck_android.yml
File metadata and controls
82 lines (66 loc) · 2.65 KB
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
78
79
80
81
82
name: "[CodeCheck] Flutter - Android"
on:
pull_request:
types: [opened, edited, reopened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# You need to uncomment [Setup - Flutter Actions with Cache] when you want to use
# different runner then our internal M1 flutter-builds runner.
env:
flutter_version: "3.38.5"
java_version: "17"
jobs:
codestyle-check-android:
name: Project CodeCheck
runs-on: ubuntu-latest
# runs-on: [self-hosted, macOS, flutter-builds] # use this for self-hosted runners
timeout-minutes: 25
steps:
- name: '[Setup - Checkout]'
uses: actions/checkout@v4.2.1
- name: '[Setup - Java]'
uses: actions/setup-java@v4.4.0
with:
distribution: 'zulu'
java-version: ${{ env.java_version }}
- name: '[Setup - Flutter Actions with Cache]'
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{ env.flutter_version }}
cache: true
architecture: x64
cache-key: 'flutter-:os:-:channel:-:version:-:arch:'
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:'
# Make sure we have latest FVM
- name: '[FVM - Install]'
run: dart pub global activate fvm
# Install correct fvm version
- name: '[FVM - Install version]'
run: fvm install ${{ env.flutter_version }}
# Install sops
- name: '[Secrets - Setup SOPS]'
uses: nhedger/setup-sops@v2
# Load secrets
- name: '[Secrets - Generate keystore and properties]'
env:
SECRETS_ENCRYPT_KEY: ${{ secrets.SECRETS_ENCRYPT_KEY }}
RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }}
RELEASE_PROPERTIES: ${{ secrets.RELEASE_PROPERTIES }}
FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_STG_APP_DISTRIBUTION_SERVICE_ACCOUNT }}
run: ./extras/secrets/tools/load-secrets.sh
# Make gen
- name: '[Flutter - Generate code]'
run: make gen
# Run linter
- name: '[Flutter - Run Linter]'
run: fvm flutter analyze
# Build is slightly faster when targeting single platform, debug version and only apk instead of appbundle
- name: '[Flutter - Build APK]'
run: fvm flutter build apk -t lib/main_staging.dart --flavor staging --target-platform android-arm64 --obfuscate --split-debug-info=build/app/outputs/symbols --debug
# Only on self hosted. Cleanup the files after the build
# - name: '[Finish - Cleanup]'
# run: |
# rm -rf ./* || true
# rm -rf ./.??* || true