Skip to content

Commit 62955ae

Browse files
Add pro app support (#61)
* feat: add pre commit hook * test: pre commit hook * fix: pre commit hook * feat: add support for free and pro product flavors
1 parent 0cbd0dc commit 62955ae

26 files changed

+88
-12
lines changed

.github/workflows/master-apk.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ jobs:
2525
run: chmod +x ./gradlew
2626

2727
- name: Build with Gradle
28-
run: ./gradlew assembleDebug
28+
run: ./gradlew assembleFreeDebug
2929

3030
- uses: "marvinpinto/action-automatic-releases@latest"
3131
with:
3232
repo_token: "${{ github.token }}"
3333
automatic_release_tag: "latest-master"
3434
prerelease: true
3535
title: "Latest Master Build"
36-
files: app/build/outputs/apk/debug/*.apk
36+
files: app/build/outputs/apk/free/debug/*.apk
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Submit to Play Store (Pro)
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'Github release version'
7+
required: true
8+
type: string
9+
push:
10+
tags:
11+
- 'v*'
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
bump:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Echo Release name
23+
run: |
24+
echo "${{ github.ref_name || github.event.inputs.version }}"
25+
26+
- name: Build Release AAB
27+
run: ./gradlew bundleProRelease
28+
29+
- name: Sign Release AAB
30+
id: signAAB
31+
uses: r0adkll/sign-android-release@fix/bundle-signing
32+
with:
33+
releaseDirectory: app/build/outputs/bundle/pro/release
34+
signingKeyBase64: ${{ secrets.PLAY_STORE_UPLOAD_SIGNING_KEY }}
35+
alias: ${{ secrets.PLAY_STORE_UPLOAD_ALIAS }}
36+
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
37+
keyPassword: ${{ secrets.KEY_PASSWORD }}
38+
39+
- name: Create service_account.json
40+
id: createServiceAccount
41+
run: echo '${{ secrets.SERVICE_ACCOUNT_JSON }}' > service_account.json
42+
43+
- name: Deploy Free to Play Store (PROD) (Free)
44+
id: deployFreeProd
45+
uses: r0adkll/[email protected]
46+
with:
47+
serviceAccountJson: service_account.json
48+
packageName: com.yogeshpaliyal.deepr
49+
releaseFiles: app/build/outputs/bundle/pro/release/*.aab
50+
track: alpha
51+
whatsNewDirectory: whatsnew/
52+

.github/workflows/playstore.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
echo "${{ github.ref_name || github.event.inputs.version }}"
2525
2626
- name: Build Release AAB
27-
run: ./gradlew bundleRelease
27+
run: ./gradlew bundleFreeRelease
2828

2929
- name: Sign Release AAB
3030
id: signAAB
3131
uses: r0adkll/sign-android-release@fix/bundle-signing
3232
with:
33-
releaseDirectory: app/build/outputs/bundle/release
33+
releaseDirectory: app/build/outputs/bundle/free/release
3434
signingKeyBase64: ${{ secrets.PLAY_STORE_UPLOAD_SIGNING_KEY }}
3535
alias: ${{ secrets.PLAY_STORE_UPLOAD_ALIAS }}
3636
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
@@ -40,13 +40,13 @@ jobs:
4040
id: createServiceAccount
4141
run: echo '${{ secrets.SERVICE_ACCOUNT_JSON }}' > service_account.json
4242

43-
- name: Deploy Free to Play Store (PROD)
43+
- name: Deploy Free to Play Store (PROD) (Free)
4444
id: deployFreeProd
4545
uses: r0adkll/[email protected]
4646
with:
4747
serviceAccountJson: service_account.json
4848
packageName: com.yogeshpaliyal.deepr
49-
releaseFiles: app/build/outputs/bundle/release/*.aab
49+
releaseFiles: app/build/outputs/bundle/free/release/*.aab
5050
track: alpha
5151
whatsNewDirectory: whatsnew/
5252

.github/workflows/pr-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838
run: bash ./gradlew lintKotlin
3939

4040
- name: 🏗 Build APK
41-
run: bash ./gradlew assembleDebug
41+
run: bash ./gradlew assembleFreeDebug
4242

4343
- name: 🚀 Upload APK to Artifacts 📱
4444
uses: actions/upload-artifact@v4
4545
with:
4646
name: app
47-
path: app/build/outputs/apk/debug/*.apk
47+
path: app/build/outputs/apk/free/debug/*.apk
4848
retention-days: 3

.github/workflows/versionBump.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
id: signApk
5353
uses: r0adkll/sign-android-release@fix/bundle-signing
5454
with:
55-
releaseDirectory: app/build/outputs/apk/release
55+
releaseDirectory: app/build/outputs/apk/free/release
5656
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
5757
alias: ${{ secrets.ALIAS }}
5858
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
@@ -76,14 +76,14 @@ jobs:
7676
7777
- name: Rename artifact names
7878
run: |
79-
mv ${{steps.signApk.outputs.signedReleaseFile}} app/build/outputs/apk/release/deepr-release-${{steps.bump-app-version.outputs.newVersion}}.apk
79+
mv ${{steps.signApk.outputs.signedReleaseFile}} app/build/outputs/apk/free/release/deepr-release-${{steps.bump-app-version.outputs.newVersion}}.apk
8080
8181
- name: Create Release
8282
uses: ncipollo/[email protected]
8383
with:
8484
tag: "${{ steps.bump-app-version.outputs.newVersion }}"
8585
generateReleaseNotes: true
8686
commit: "master"
87-
artifacts: "app/build/outputs/apk/release/deepr-release-${{steps.bump-app-version.outputs.newVersion}}.apk"
87+
artifacts: "app/build/outputs/apk/free/release/deepr-release-${{steps.bump-app-version.outputs.newVersion}}.apk"
8888
discussionCategory: "Release feedbacks"
8989
makeLatest: true

app/build.gradle.kts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,16 @@ android {
2121
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2222
}
2323

24-
buildTypes {
24+
productFlavors {
25+
create("free") {
26+
isDefault = true
27+
}
28+
create("pro") {
29+
applicationIdSuffix = ".pro"
30+
}
31+
}
2532

33+
buildTypes {
2634
debug {
2735
applicationIdSuffix = ".debug"
2836
versionNameSuffix = "-debug"
@@ -48,6 +56,8 @@ android {
4856
buildConfig = true
4957
}
5058

59+
flavorDimensions("default")
60+
5161
signingConfigs {
5262
getByName("debug") {
5363
storeFile = file("../keystores/debug.keystore")
54.5 KB
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_launcher_background"/>
4+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
5+
</adaptive-icon>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_launcher_background"/>
4+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
5+
</adaptive-icon>
1.84 KB
Loading

0 commit comments

Comments
 (0)