-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (98 loc) · 3.8 KB
/
Android_Release_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
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
name: Android Release New Version 🎉
on:
push:
tags:
- "v*.*.*"
jobs:
CI_Android_Release:
uses: ./.github/workflows/Android_Release_CI.yml
secrets: inherit
Distribution_To_PlayStore:
name: CD Release Builder
runs-on: ubuntu-latest
needs: [ CI_Android_Release ]
steps:
- uses: actions/checkout@v4
- name: show github pull request
run: echo ${{ github.event.pull_request.title }}
- name: Gradle cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Create Google-Services.json
env:
GOOGLE_SERVICES_ALPHA: ${{ secrets.GOOGLE_SERVICES_ALPHA }}
GOOGLE_SERVICES_BETA: ${{ secrets.GOOGLE_SERVICES_BETA }}
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
run: |
touch ./app/src/debug/google-services.json
touch ./app/src/alpha/google-services.json
touch ./app/src/beta/google-services.json
mkdir ./app/src/release
touch ./app/src/release/google-services.json
echo $GOOGLE_SERVICES_ALPHA >> ./app/src/debug/google-services.json
echo $GOOGLE_SERVICES_ALPHA >> ./app/src/alpha/google-services.json
echo $GOOGLE_SERVICES_BETA >> ./app/src/beta/google-services.json
echo $GOOGLE_SERVICES >> ./app/src/release/google-services.json
cat ./app/src/debug/google-services.json
working-directory: android
- name: Create Local Properties
run: touch local.properties
working-directory: android
- name: Access Local Properties
env:
POKE_BASE_URL: ${{ secrets.POKE_BASE_URL }}
# POKE_DEV_BASE_URL: ${{ secrets.HOST_RELEASE_URI }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
run: |
echo POKE_BASE_URL=\"${{ secrets.POKE_BASE_URL }}\" >> local.properties
echo STORE_PASSWORD= $STORE_PASSWORD >> local.properties
echo KEY_PASSWORD= $KEY_PASSWORD >> local.properties
echo KEY_ALIAS= $KEY_ALIAS >> local.properties
working-directory: android
- name: Create RELEASE Key Store
env:
KEY_STORE: ${{secrets.RELEASE_KEY_STORE}}
run: |
touch ./keystore/poke_key.keystore
echo "$KEY_STORE" | base64 -d > ./keystore/poke_key.keystore
working-directory: android
- name: Grant execute permission for gradlew
run: chmod +x gradlew
working-directory: android
- name: Build Release APK
run: ./gradlew assembleRelease
working-directory: android
- name: Upload Release Build to Artifacts
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: android/app/build/outputs/apk/release/
if-no-files-found: error
- name: Create Github Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
android/app/build/outputs/apk/release/app-release.apk
- name: Build release aab
run: ./gradlew bundleRelease
working-directory: android
- name: Upload artifact to Google Play Store
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
releaseFiles: android/app/build/outputs/bundle/release/app-release.aab
packageName: poke.rogue.helper