-
Notifications
You must be signed in to change notification settings - Fork 10
131 lines (113 loc) · 4.65 KB
/
release.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
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
name: Android CI Release
on:
push:
branches:
- master
tags:
- v*
env:
java_version: '11.0.14+9'
ruby_version: '2.7.2'
flutter_version: '3.16.3'
jobs:
android-internal:
name: Google Play internal
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Read YAML Data
uses: KJ002/[email protected]
id: pubspec
with:
file: 'pubspec.yaml'
key-path: '["version"]'
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby_version }}
bundler-cache: true
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'adopt-hotspot'
java-version: ${{ env.java_version }}
cache: 'gradle'
- name: Cache Flutter dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.android/build-cache
/opt/hostedtoolcache/flutter
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }}
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: ${{ env.flutter_version }}
- name: Flutter pub dependencies
run: flutter pub get
- name: Flutter add intl and run build_runner
run: |
flutter pub add intl_utils
flutter pub run intl_utils:generate
flutter pub run build_runner build
- name: Configure Keystore
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
run: |
mkdir -p ~/android
echo "$PRIVATE_KEY" > AN_key.p12.b64
base64 -d -i AN_key.p12.b64 > android/AN_key.p12
echo "storeFile=../AN_key.p12" >> android/key.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> android/key.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> android/key.properties
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> android/key.properties
- name: Create Google Play Config file
id: createServiceAccount
run: echo '${{ secrets.PLAY_STORE_KEY }}' > android/api-play-store-key.json
- name: Create Firebase Configuration Files forn Native / Flutter
env:
GOOGLE_SERVICES_ANDROID: ${{ secrets.GOOGLE_SERVICES_ANDROID_JSON }}
GOOGLE_SERVICES_IOS: ${{ secrets.GOOGLE_SERVICES_IOS_PLIST }}
FIREBASE_APP_ID_IOS: ${{ secrets.FIREBASE_APP_ID_IOS_JSON }}
FIREBASE_OPTIONS_DART: ${{ secrets.FIREBASE_OPTIONS_DART }}
run: |
echo Android google_services.json
echo "$GOOGLE_SERVICES_ANDROID" > google-services.json.b64
base64 -d -i google-services.json.b64 > android/app/google-services.json
echo iOS google_services.json
echo "$GOOGLE_SERVICES_IOS" > GoogleService-Info.plist.b64
base64 -d -i GoogleService-Info.plist.b64 > ios/Runner/GoogleService-Info.plist
echo iOS Firebase APP ID
echo "$FIREBASE_APP_ID_IOS" > firebase_app_id_file.json.b64
base64 -d -i firebase_app_id_file.json.b64 > ios/firebase_app_id_file.json
echo Firebase .dart file
echo "$FIREBASE_OPTIONS_DART" > FIREBASE_OPTIONS_DART.dart.b64
base64 -d -i FIREBASE_OPTIONS_DART.dart.b64 > lib/firebase_options.dart
- name: Build apk and appbundle
run: |
flutter build apk --no-pub --release --obfuscate --split-debug-info=build/app/outputs/apk-symbols/symbols
flutter build appbundle --no-pub --obfuscate --split-debug-info=build/app/outputs/aab-symbols/symbols
- name: Upload aab symbols to firebase
uses: w9jds/firebase-action@master
with:
args: crashlytics:symbols:upload --app=${{ secrets.FIREBASE_ANDROID_APP_ID }} build/app/outputs/aab-symbols/symbols
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
- name: Build appbundle and upload to google play
run: bundle exec fastlane android internal
- name: Create Github Release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ steps.pubspec.outputs.data }}"
draft: true
prerelease: true
files: build/app/outputs/flutter-apk/app-release.apk