-
Notifications
You must be signed in to change notification settings - Fork 36
133 lines (107 loc) · 3.43 KB
/
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: ci
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- name: Get dependencies
run: flutter pub get
- name: Generate l10n
run: |
flutter gen-l10n
dart format lib/l10n/gen/
- name: Run lints
run: flutter analyze
- name: Check formatting
run: dart format --set-exit-if-changed .
- name: Run tests
run: flutter test
android:
name: Android
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- name: Generate debug keystore (Pull Request)
if: github.event_name == 'pull_request'
run: keytool -genkey -v -keystore /home/runner/work/liftoff/liftoff/android/app/key.jks -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
- name: Android build (Pull Request)
if: github.event_name == 'pull_request'
env:
ANDROID_KEY_ALIAS: androiddebugkey
ANDROID_KEY_PASSWORD: android
ANDROID_STORE_PATH: key.jks
ANDROID_STORE_PASSWORD: android
run: flutter build apk --split-per-abi --release --target lib/main_prod.dart --flavor preview
- name: Inject keystore
working-directory: android/app
if: github.event_name != 'pull_request'
run: |
echo "${{ secrets.SIGNING_KEY }}" | base64 -d | tee key.jks >/dev/null
- name: Android build (Master Branch)
if: github.event_name != 'pull_request'
env:
ANDROID_KEY_ALIAS: ${{ secrets.ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
ANDROID_STORE_PATH: key.jks
ANDROID_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
run: flutter build apk --split-per-abi --release --target lib/main_prod.dart --flavor preview
- uses: actions/upload-artifact@v2
with:
name: android-debug-apk
path: build/app/outputs/flutter-apk/
ios:
name: iOS
runs-on: macos-latest
needs: lint
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: "stable"
- run: flutter build ios --no-codesign --release --target lib/main_prod.dart --flavor prod
linux:
name: Linux
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- name: Get additional dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev
- name: Build
run: |
flutter build linux --release --target lib/main_prod.dart
windows:
name: Windows
runs-on: windows-latest
needs: lint
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- name: Build
run: |
flutter build windows --release --target lib/main_prod.dart