-
Notifications
You must be signed in to change notification settings - Fork 23
129 lines (108 loc) · 3.85 KB
/
aab.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
name: AAB
on:
push:
branches: [release]
jobs:
linter:
runs-on: ubuntu-latest
name: Lint flutter code
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.27.3'
- name: Initialize Flutter
run: bash -x ./flutter-init.sh
- name: Copy Analysis Options
run: cp -f ./src/ui/flutter_app/analysis_options.yaml ./
- name: Analyze Flutter
uses: ValentinVignal/[email protected]
with:
fail-on: 'format'
working-directory: src/ui/flutter_app
build:
runs-on: ubuntu-latest
needs: linter
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Decode signing key
run: echo $SIGNING_KEY | base64 -d > src/ui/flutter_app/android/app/key.jks
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.27.3'
- name: Export environment variables
run: export
- name: Create App version
run: |
git fetch --tags
git tag
git log -n1
bash -x ./version.sh
- name: Print Flutter SDK version
run: flutter --version
- name: Install dependencies
run: bash -x ./flutter-init.sh
# Build APK and AAB
- name: Build APK and AAB
run: |
cd src/ui/flutter_app
rm android/app/build.gradle
mv android/app/build.gradle_github android/app/build.gradle
flutter build apk -v
flutter build appbundle -v
env:
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
ALIAS: ${{ secrets.ALIAS }}
KEY_PATH: key.jks
# Archive APK
- name: Archive APK
uses: actions/upload-artifact@v4
with:
name: sanmill-flutter-apk-release
path: src/ui/flutter_app/build/app/outputs/flutter-apk/app-release.apk
# Archive AAB
- name: Archive AAB
uses: actions/upload-artifact@v4
with:
name: sanmill-flutter-aab-release
path: src/ui/flutter_app/build/app/outputs/bundle/release/app-release.aab
# Authenticate to Google Cloud using Workload Identity Federation
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v2
with:
token_format: iam_json # Obtain JSON format credentials
workload_identity_provider: "projects/391539675971/locations/global/workloadIdentityPools/github-pool/providers/github-provider"
service_account: "[email protected]"
# Write credentials to a temporary file
- name: Write credentials to file
run: |
echo "${{ steps.auth.outputs.credential_json }}" > /tmp/credentials.json
# Upload to Google Play Store
- name: Upload to Google Play Store
uses: swootte/[email protected]
with:
serviceAccountJson: /tmp/credentials.json # Path to temporary credentials file
packageName: com.calcitem.sanmill
releaseFile: src/ui/flutter_app/build/app/outputs/bundle/release/app-release.aab
track: internal
inAppUpdatePriority: 2
userFraction: 1.00
whatsNewDirectory: distribution/whatsnew
mappingFile: src/ui/flutter_app/build/app/outputs/mapping/release/mapping.txt
status: draft
changesNotSentForReview: true