-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (70 loc) · 2.69 KB
/
CI_STORE_DEPLOY_ANDROID.yaml
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
## Github Actions CI workflow to deploy to Internal testing in the Play Store
name: CI_STORE_DEPLOY_ANDROID
on:
# Run this workflow when any new code is pushed into the main branch
push:
branches: [main]
jobs:
store_deploy_android:
name: android store release
runs-on: ubuntu-latest
env:
# Setup env variables that will be used throughout the workflow
JAVA_VERSION: 12.0
FLUTTER_VERSION: 3.24.0
AAB_PATH: build/app/outputs/bundle/release/app-release.aab
KEYSTORE_PATH: android/upload-keystore.jks
KEY_PROPS_PATH: android/key.properties
SERVICE_ACCOUNT_PATH: store_credentials.json
PACKAGE_NAME: tech.bunnie.hub_finder
steps:
# Checkout repository codebase
- name: Checkout the code
uses: actions/checkout@v3
# Setup Java in the VM
- name: Setup Java to compile the Android project
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: ${{ env.JAVA_VERSION }}
# Setup Flutter in the VM
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
# Decode Android env variables
- name: Decode Android keystore
run: echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 --decode > ${{ env.KEYSTORE_PATH }}
- name: Decode Android key properties
run: echo "${{ secrets.ANDROID_KEY_PROPERTIES }}" | base64 --decode > ${{ env.KEY_PROPS_PATH }}
# Decode Android release Service Account
- name: Decode Android Service Account
run: echo "${{ secrets.PRODUCTION_CREDENTIAL_FILE }}" | base64 --decode > ${{ env.SERVICE_ACCOUNT_PATH }}
# Run flutter commands
- name: Run flutter pub get
run: flutter pub get
- name: 📦 Install dependencies
run: flutter pub get
- name: 🕵️ Analyze to check for bad Dart/Flutter practices
run: flutter analyze
- name: 📉 Run all app tests
run: flutter test
# Build Android Bundle release file
- name: Build aab
run: |
flutter build appbundle
--release
# Upload generated aab to project artifacts
- name: Upload generated aab to the artifacts
uses: actions/upload-artifact@master
with:
name: aab-stores
path: ${{ env.AAB_PATH }}
# Deploy bundle to Google Play internal testing
- name: Deploy to Play Store (Internal testing)
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: ${{ env.SERVICE_ACCOUNT_PATH }}
packageName: ${{ env.PACKAGE_NAME }}
releaseFiles: ${{ env.AAB_PATH }}
track: internal