-
Notifications
You must be signed in to change notification settings - Fork 0
229 lines (199 loc) · 6.61 KB
/
main.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
name: Main Branch
'on':
push:
branches:
- main
workflow_dispatch: null
concurrency:
group: '${{ github.head_ref || github.ref }}-main'
cancel-in-progress: true
env:
ALPHA_ANDROID_FIREBASE_TESTERS_GROUP: android-testers
ANDROID_FIREBASE_APP_ID: ${{ secrets.ANDROID_FIREBASE_APP_ID }}
JAVA_VERSION: '12'
RUBY_VERSION: '2.7'
LC_ALL: en_US.UTF-8
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
LANG: en_US.UTF-8
jobs:
generate-coverage:
timeout-minutes: 10
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
token: ${{ secrets.ACTIONS_PERSONAL_TOKEN }}
- uses: kuhnroyal/flutter-fvm-config-action@v1
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
- name: pub get
run: flutter pub get
- name: generate coverage index file
run: make generate_coverage_index_file
- name: generate code coverage
timeout-minutes: 4
run: |
flutter test --dart-define=IS_CI=true --coverage --coverage-path=coverage/main.lcov.info
lcov --remove coverage/main.lcov.info 'lib/*/*.g.dart' 'lib/generated_assets/*.dart' 'lib/*/*.gen.dart' 'lib/generated_plugin_registrant.dart' -o coverage/main.lcov.info
- uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: coverage/main.lcov.info
commit_message: update coverage [skip-ci]
deploy-android:
needs: generate-coverage
timeout-minutes: 30
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 10
- uses: kuhnroyal/flutter-fvm-config-action@v1
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
- name: pub get
run: flutter pub get
- name: set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 8
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: prepare fastlane
working-directory: ./android
run: |
gem install bundler
bundle install
- name: prepare android build with cosmos testnet
run: >
flutter build apk --build-number $GITHUB_RUN_NUMBER
--profile
--dart-define=LCD_URL=https://api.testnet.cosmos.network
--dart-define=LCD_PORT=443
--dart-define=GRPC_URL=https://grpc.testnet.cosmos.network
--dart-define=GRPC_PORT=443
- name: deploy firebase Android
working-directory: ./android
run: |
gem install bundler
bundle install
bundle exec fastlane deploy_firebase
- name: Report Status
id: slack
if: failure()
uses: slackapi/[email protected]
with:
payload: |
{
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Emeris Android deployment failed: :red_circle:"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":arrow_right: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
},
{
"type": "context",
"elements": [
{
"type": "plain_text",
"text": "branch: ${{ github.ref_name}}",
"emoji": true
}
]
}
]
}
}
deploy-ios:
needs: generate-coverage
timeout-minutes: 30
runs-on: macos-11
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 10
- uses: kuhnroyal/flutter-fvm-config-action@v1
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
- name: pub get
working-directory: ./ios
run: flutter pub get
- name: set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- name: prepare fastlane
working-directory: ./ios
run: |
gem install bundler
bundle install
bundle exec fastlane prepare_certificates
- name: prepare ios build with cosmos testnet
run: |
flutter build ipa --profile --build-number $GITHUB_RUN_NUMBER --dart-define=LCD_URL=https://api.testnet.cosmos.network --dart-define=LCD_PORT=443 --dart-define=GRPC_URL=https://grpc.testnet.cosmos.network --dart-define=GRPC_PORT=443
- name: deploy firebase iOS
working-directory: ./ios
run: |
bundle exec fastlane deploy_firebase
- name: Report Status
id: slack
if: failure()
uses: slackapi/[email protected]
with:
payload: |
{
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Emeris iOS deployment failed: :red_circle:"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":arrow_right: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
},
{
"type": "context",
"elements": [
{
"type": "plain_text",
"text": "branch: ${{ github.ref_name}}",
"emoji": true
}
]
}
]
}
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK