-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (78 loc) · 3.02 KB
/
deploy-android.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
name: Android Build CI/CD
# Only code merged to main with new release notes can be released as a build.
on:
push:
branches: [ main ]
paths:
- 'native_gg/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
android-build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: native_gg
timeout-minutes: 10
steps:
- uses: actions/[email protected]
- uses: dorny/[email protected]
id: changes
with:
filters: |
whatsNew:
- 'native_gg/android/WhatsNew/**'
- uses: pnpm/[email protected]
with:
version: 8.15.1
- uses: actions/[email protected]
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
- name: install dependencies
run: pnpm install --frozen-lockfile
- name: add .env file
run: echo '${{ secrets.CLIENT_SECRETS }}' > .env
# Automatically overrides the version code and version name through the github actions
- name: Bump version
uses: chkfung/[email protected]
with:
gradlePath: native_gg/android/app/build.gradle
versionCode: ${{github.run_number}}
versionName: '1.0.0'
- name: Setup Gradle
uses: gradle/actions/[email protected]
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
# Use ./gradlew and not gradle as that uses the wrapper and the correct version of gradle
- run: cd android && ./gradlew bundleRelease --scan
- name: Sign ABB
uses: r0adkll/sign-android-release@v1
# ID used to access action output
id: sign_app
with:
releaseDirectory: native_gg/android/app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Upload Artifact
uses: actions/[email protected]
with:
name: Signed app bundle
path: ${{steps.sign_app.outputs.signedReleaseFile}}
retention-days: 4
# Distribute App to google play
- name: Publish to Play Store internal test track
if: ${{ steps.changes.outputs.whatsNew == 'true' }}
uses: r0adkll/[email protected]
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.guardianghost
releaseFiles: native_gg/android/app/build/outputs/bundle/release/app-release.aab
whatsNewDirectory: native_gg/android/WhatsNew
track: internal
# TODO: Change to completed or remove the status line once alpha or beta testing tracks are ready.
status: draft
inAppUpdatePriority: 3