-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (74 loc) · 2.74 KB
/
an-cd.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
name: Android CD Pipeline
on:
push:
branches:
- an/release
jobs:
build_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'gradle'
- name: Set Up Gradlew Permissions
run: chmod +x gradlew
- name: Create google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: |
echo $GOOGLE_SERVICES_JSON > ./android/app/google-services.json
- name: Set up environment variable for BuildConfig
env:
GOOGLE_WEB_CLIENT_ID: ${{ secrets.GOOGLE_WEB_CLIENT_ID }}
BASE_URL_DEV: ${{ secrets.BASE_URL_DEV }}
BASE_URL_API: ${{ secrets.BASE_URL_API }}
run: |
echo google_web_client_id=\"$GOOGLE_WEB_CLIENT_ID\" > ./android/local.properties
echo base_url_dev=\"$BASE_URL_DEV\" >> ./android/local.properties
echo base_url_release=\"$BASE_URL_API\" >> ./android/local.properties
- name: Build and test
run: ./gradlew build test
working-directory: ./android
distribute:
name: Deploy aab file to Google Play Console
needs: build_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'gradle'
- name: Bumping Version
uses: chkfung/[email protected]
with:
gradlePath: ./android/app/build.gradle.kts
versionCode: ${{ github.run_number }}
- name: Assemble Release Bundle
run: ./gradlew bundleRelease
- name: Sign app aab
uses: Tlaster/android-sign@v1
with:
releaseDirectory: ./android/app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} # Keystore file base64
output: ./android/build/release/signed
alias: ${{ secrets.ANDROID_ALIAS }}
keyStorePassword: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "30.0.2"
- name: Set Up Authorization with Google Play
run: echo '${{ secrets.ANDROID_PLAY_AUTH }}' > ./android/service_account.json
- name: Deploy AAB to Google Play Console
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ./android/service_account.json
packageName: net.pengcook.android
releaseFiles: ./android/app/build/outputs/bundle/release/app-release.aab
track: internal