diff --git a/.github/workflows/generate-aab-release.yml b/.github/workflows/generate-aab-release.yml index d1b341ae..e839b5a7 100644 --- a/.github/workflows/generate-aab-release.yml +++ b/.github/workflows/generate-aab-release.yml @@ -27,13 +27,13 @@ jobs: - name: Build Release AAB id: buildRelease - run: ./gradlew bundleRelease + run: ./gradlew bundleFreeRelease - name: Sign AAB id: sign uses: r0adkll/sign-android-release@fix/bundle-signing with: - releaseDirectory: app/build/outputs/bundle/release + releaseDirectory: app/build/outputs/bundle/freeRelease signingKeyBase64: ${{ secrets.SIGNING_KEY }} alias: ${{ secrets.ALIAS }} keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} @@ -43,5 +43,5 @@ jobs: uses: actions/upload-artifact@v4 with: name: app - path: app/build/outputs/bundle/release/*.aab + path: app/build/outputs/bundle/freeRelease/*.aab retention-days: 3 diff --git a/.github/workflows/generate-pro-aab-release.yml b/.github/workflows/generate-pro-aab-release.yml new file mode 100644 index 00000000..4cc04d5e --- /dev/null +++ b/.github/workflows/generate-pro-aab-release.yml @@ -0,0 +1,47 @@ +name: Generate AAB File + +on: + workflow_dispatch: + inputs: + ref: + description: 'Reference branch, tag, commit id' + required: true + type: string + + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} + + - name: Setting up project + uses: ./.github/actions/setup + + - name: Build with Gradle + id: build + run: ./gradlew build + + - name: Build Release AAB + id: buildRelease + run: ./gradlew bundleProRelease + + - name: Sign AAB + id: sign + uses: r0adkll/sign-android-release@fix/bundle-signing + with: + releaseDirectory: app/build/outputs/bundle/proRelease + signingKeyBase64: ${{ secrets.SIGNING_KEY_WITH_PRO }} + alias: pro + keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} + keyPassword: ${{ secrets.KEY_PASSWORD }} + + - name: 🚀 Upload APK to Artifacts 📱 + uses: actions/upload-artifact@v4 + with: + name: app + path: app/build/outputs/bundle/proRelease/*.aab + retention-days: 3 diff --git a/.github/workflows/master-apk-create.yml b/.github/workflows/master-apk-create.yml index 305c2e92..5c8edb02 100644 --- a/.github/workflows/master-apk-create.yml +++ b/.github/workflows/master-apk-create.yml @@ -25,7 +25,7 @@ jobs: uses: ./.github/actions/setup - name: Build APK ⚙️🛠 - run: bash ./gradlew assembleDebug + run: bash ./gradlew assembleFreeDebug - uses: "marvinpinto/action-automatic-releases@latest" @@ -34,4 +34,4 @@ jobs: automatic_release_tag: "latest-master" prerelease: true title: "Staging Build" - files: app/build/outputs/apk/debug/*.apk + files: app/build/outputs/apk/*/*.apk diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index 8bad2260..6dba24d9 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -31,11 +31,11 @@ jobs: run: ./gradlew test - name: 🏗 Build APK - run: bash ./gradlew assembleDebug + run: bash ./gradlew assembleFreeDebug - name: 🚀 Upload APK to Artifacts 📱 uses: actions/upload-artifact@v4 with: name: app - path: app/build/outputs/apk/debug/*.apk + path: app/build/outputs/apk/free/debug/*.apk retention-days: 3 diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index bc88b6d2..4c849994 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -21,33 +21,53 @@ jobs: id: build run: ./gradlew build - - name: Build Release AAB + - name: Build Free and Pro Release AAB id: buildRelease run: ./gradlew bundleRelease - - name: Sign AAB + - name: Sign Free AAB id: sign uses: r0adkll/sign-android-release@fix/bundle-signing with: - releaseDirectory: app/build/outputs/bundle/release - signingKeyBase64: ${{ secrets.SIGNING_KEY }} + releaseDirectory: app/build/outputs/bundle/freeRelease + signingKeyBase64: ${{ secrets.SIGNING_KEY_WITH_PRO }} alias: ${{ secrets.ALIAS }} keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} keyPassword: ${{ secrets.KEY_PASSWORD }} + - name: Sign Pro AAB + id: sign + uses: r0adkll/sign-android-release@fix/bundle-signing + with: + releaseDirectory: app/build/outputs/bundle/proRelease + signingKeyBase64: ${{ secrets.SIGNING_KEY_WITH_PRO }} + alias: pro + keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} + keyPassword: ${{ secrets.KEY_PASSWORD }} + - name: Create service_account.json id: createServiceAccount run: echo '${{ secrets.SERVICE_ACCOUNT_JSON }}' > service_account.json - - - - name: Deploy to Play Store (PROD) - id: deployProd + - name: Deploy Free to Play Store (PROD) + id: deployFreeProd uses: r0adkll/upload-google-play@v1.1.3 with: serviceAccountJson: service_account.json packageName: com.yogeshpaliyal.keypass - releaseFiles: app/build/outputs/bundle/release/*.aab + releaseFiles: app/build/outputs/bundle/freeRelease/*.aab + track: production + userFraction: 0.01 + status: inProgress + whatsNewDirectory: whatsnew/ + + - name: Deploy Pro to Play Store (PROD) + id: deployProProd + uses: r0adkll/upload-google-play@v1.1.3 + with: + serviceAccountJson: service_account.json + packageName: com.yogeshpaliyal.keypass.pro + releaseFiles: app/build/outputs/bundle/proRelease/*.aab track: production userFraction: 0.01 status: inProgress diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b6581c2c..e40d07a8 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -42,6 +42,16 @@ android { } } + + productFlavors { + create("free") { + isDefault=true + } + create("pro") { + applicationIdSuffix = ".pro" + } + } + compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17