-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (91 loc) · 3.54 KB
/
android-release.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
# Create android release AAB and upload play store
# Required Secrets
# - ANDROID_KEY_ALIAS
# - ANDROID_KEY_PASSWORD
# - ANDROID_KEY_STORE_PASSWORD
# - ANDROID_SIGNING_KEY_B64
# - GOOGLE_PLAY_SERVICE_ACCOUNT_JSON
# - GOOGLE_SERVICES_JSON
name: Android - Release to Google Play
on:
release:
types: [published]
workflow_dispatch:
# push:
# branches:
# - main
jobs:
android_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
#############################################################################
# Node Modules
# Manually restore any previous cache to speed install
# As immutable install will not change cache only save new cache if not hit
# Uses fine-grained methods from https://github.com/actions/cache
#############################################################################
- uses: actions/cache/restore@v3
id: cache
with:
path: ./.yarn/cache
key: ${{ runner.os }}-node-modules-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-modules-yarn-v1-
- name: Install node modules
run: yarn install --immutable
- uses: actions/cache/save@v3
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ./.yarn/cache
key: ${{ runner.os }}-node-modules-yarn-v1-${{ hashFiles('yarn.lock') }}
- name: Populate google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $GOOGLE_SERVICES_JSON > apps/picsa-apps/extension-app-native/android/app/google-services.json
- name: Install Dependencies
run: yarn install
- name: Build Extension App
run: yarn nx run picsa-apps-extension-app-native:build
# Re-sync as remote cache won't populate files during nx build command
- name: Sync Capacitor
run: npx cap sync
working-directory: apps/picsa-apps/extension-app-native
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- name: Setup Android SDK
uses: android-actions/setup-android@v2
# - name: Build Android Debug APK
# working-directory: apps/picsa-apps/extension-app-native/android
# run: ./gradlew :app:assembleDebug
- name: Build Android Release Bundle
working-directory: apps/picsa-apps/extension-app-native/android
run: ./gradlew :app:bundleRelease
- name: Sign Android Release
id: sign_aab
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: apps/picsa-apps/extension-app-native/android/app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY_B64 }}
alias: ${{ secrets.ANDROID_KEY_ALIAS }}
keyStorePassword: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
- name: Upload to Google play
uses: r0adkll/[email protected]
with:
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
packageName: io.picsa.extension
releaseFiles: ${{steps.sign_aab.outputs.signedReleaseFile}}
track: internal
env:
GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}