-
-
Notifications
You must be signed in to change notification settings - Fork 3
75 lines (62 loc) · 2.3 KB
/
build_and_deploy.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
name: Build and Deploy to Play Store
on:
push:
tags:
- "v*"
jobs:
build:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "17"
- name: Set up Flutter
uses: subosito/flutter-action@v2
- run: flutter --version
- name: Reconstruct Keystore File
run: |
echo ${{ secrets.KEYSTORE_BASE64 }} | base64 --decode > $HOME/keystore.jks
echo "KEYSTORE_FILE=$HOME/keystore.jks" >> $GITHUB_ENV
- name: Set up environment for signing
run: |
echo "KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> $GITHUB_ENV
echo "KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> $GITHUB_ENV
echo "STORE_PASSWORD=${{ secrets.STORE_PASSWORD }}" >> $GITHUB_ENV
- name: Extract version from tag
id: extract_version
run: |
TAG=${GITHUB_REF#refs/tags/}
VERSION=${TAG#v}
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Update pubspec.yaml
run: |
cd $GITHUB_WORKSPACE
sed -i "s/^version: .*/version: ${{ env.VERSION }}/" pubspec.yaml
- name: Install dependencies
run: flutter pub get
- name: Build AAB
run: flutter build appbundle --release
- name: Upload AAB to Play Store
id: upload_google_play
uses: r0adkll/upload-google-play@v1
with:
packageName: ${{ secrets.PACKAGE_NAME }}
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
inAppUpdatePriority: ${{ secrets.UPDATE_PRIORITY }} # Between 0-5 => Higher the number, higher the priority.
releaseFiles: build/app/outputs/bundle/release/app-release.aab
mappingFile: build/app/outputs/mapping/release/mapping.txt
debugSymbols: build/app/intermediates/merged_native_libs/release/out/lib
track: internal
status: draft
# changesNotSentForReview: ${{ secrets.DONT_SEND_CHANGES_FOR_REVIEW }} # true or false
- name: Cleanup
run: |
echo "Cleaning up temporary files..."
rm -rf build
rm $HOME/keystore.jks
echo "Cleanup complete."