-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (66 loc) · 2.51 KB
/
android-beta.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
name: Build & Deploy Android Beta
on:
push:
branches:
- 'release/**'
env:
FLUTTER_CHANNEL: 'stable'
FLUTTER_VERSION: '2.8.1'
JAVA_VERSION: '17.0.1+12'
RUBY_VERSION: '3.0.3'
BUNDLER_VERSION: '2.3.0'
jobs:
build_android_staging:
name: Build Android Beta
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: ${{ env.JAVA_VERSION }}
- uses: subosito/flutter-action@v1
with:
channel: ${{ env.FLUTTER_CHANNEL }}
flutter-version: ${{ env.FLUTTER_VERSION }}
- run: flutter pub get
- run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Build app
env:
UPLOAD_KEYSTORE_FILE: ${{ secrets.UPLOAD_KEYSTORE_FILE }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
run: |
echo $UPLOAD_KEYSTORE_FILE | base64 -di > ./android/app/upload-key.jks
flutter build apk -t lib/main_staging.dart --release --flavor staging --build-number=${{ github.run_number }} --dart-define=DEFINE_API_BASE_URL=${{ secrets.CI_TEST_API_URL_STAGING }}
- uses: actions/upload-artifact@v2
with:
name: android-beta
path: build/app/outputs/flutter-apk/app-staging-release.apk
retention-days: 1
deploy_android_staging:
name: Deploy Android Beta
runs-on: ubuntu-20.04
needs: build_android_staging
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- uses: actions/download-artifact@v2
with:
name: android-beta
path: build/app/outputs/flutter-apk
- run: stat build/app/outputs/flutter-apk/app-staging-release.apk
- name: Deploy app
env:
CI_TEST_FIREBASE_SERVICE_ACCOUNT_STAGING: ${{ secrets.CI_TEST_FIREBASE_SERVICE_ACCOUNT_STAGING }}
CI_TEST_ANDROID_FIREBASE_APP_ID_STAGING: ${{ secrets.CI_TEST_ANDROID_FIREBASE_APP_ID_STAGING }}
run: |
cd android
echo $CI_TEST_FIREBASE_SERVICE_ACCOUNT_STAGING > ./service-account.json
export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/service-account.json
gem install bundler -v ${{ env.BUNDLER_VERSION }}
bundle install
bundle exec fastlane deploy_android_beta