-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathandroid-build.yml
72 lines (58 loc) · 2.12 KB
/
android-build.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
name: Android Build
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains multiple job which run sequentially
# Job-1 ("build") : It builds android apk and uploads it to artifacts
build:
name: Build Android Apk
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install flutter sdk
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install dependencies
run: flutter pub get
- name: Generate localization files
run: |
flutter pub global activate intl_utils
flutter pub global run intl_utils:generate
- name: Generate boilerplate code using build_runner
run: dart run build_runner build -d
- name: Build apk
run: flutter build apk
- name: Collect apk file and upload as artifacts
uses: actions/upload-artifact@v4
with:
name: release-apk
path: build/app/outputs/flutter-apk/app-release.apk
# Job-2 ("release") : It retrieves the android apk from artifacts and uploads it to firebase app distributions
release:
name: Release apk to firebase app distributions
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get release-apk from artifacts
uses: actions/download-artifact@v4
with:
name: release-apk
- name: Upload artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{secrets.FIREBASE_ANDROID_APP_ID}}
serviceCredentialsFileContent: ${{ secrets.FIREBASE_CREDENTIAL_FILE_CONTENT }}
groups: android-testers
file: app-release.apk