Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fdroid build #69

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/build-deploy-internal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build App & Deploy Internal

on:
push:
branches: [develop]
workflow_dispatch:

jobs:
build:
name: Build
uses: ./.github/workflows/common-build-workflow.yml
secrets: inherit
with:
upload-artifact: true


deploy:
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:

- name: Checkout the code
uses: actions/checkout@v3

- name: Download aab
uses: actions/download-artifact@v4
with:
name: app-release.aab
- name: Decode Base64 Keystore

env:
JSON_KEY_BASE64: ${{ secrets.ANDROID_API_JSON_KEY }}
run: echo $JSON_KEY_BASE64 | base64 --decode > publish.json

- name: Deploy on Google Play Internal Track
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: ./publish.json
packageName: com.lolo.io.onelist
releaseFiles: app-release.aab
whatsNewDirectory: whatsnew
track: internal

14 changes: 14 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Build App

on:
pull_request:
branches: [develop]
workflow_dispatch:

jobs:
build:
name: Build
uses: ./.github/workflows/common-build-workflow.yml
secrets: inherit
with:
upload-artifact: false
58 changes: 58 additions & 0 deletions .github/workflows/common-build-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: .reusable-workflow-build-app

on:
workflow_call:
inputs:
upload-artifact:
required: true
type: boolean

jobs:
build:
runs-on: ubuntu-latest
name: Build App
steps:

- name: Checkout the code
uses: actions/checkout@v3

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: oracle
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Decode Base64 Keystore
env:
KEYSTORE_BASE64: ${{ secrets.ANDROID_SIGNING_KEYSTORE }}
run: echo $KEYSTORE_BASE64 | base64 --decode > keystore.jks
working-directory: ./app

- name: Prepare Version Code
id: versionCode
run: |
sum=`expr ${{vars.VERSION_CODE_OFFSET}} + ${{github.run_number}}`
echo "versionCode=$sum" >> "$GITHUB_OUTPUT"

- name: Prepare version.properties
run: |
touch version.properties && \
echo "VERSION_CODE=${{ steps.versionCode.outputs.versionCode }}" >> version.properties

- name: Assemble & Sign App Release Bundle
env:
ONELIST_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEYSTORE_PASSWORD }}
ONELIST_KEYSTORE_ALIAS: ${{ secrets.ONELIST_KEYSTORE_ALIAS }}
ONELIST_KEYSTORE_ALIAS_PASSWORD: ${{ secrets.ONELIST_KEYSTORE_ALIAS_PASSWORD }}
run: ./gradlew bundleRelease

- name: Upload aab
if: inputs.upload-artifact
uses: actions/upload-artifact@v4
with:
name: app-release.aab
path: app/build/outputs/bundle/release/app-release.aab

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
/build
/captures
.externalNativeBuild
keystore.jks
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/build
/release
keystore.jks
100 changes: 0 additions & 100 deletions app/build.gradle

This file was deleted.

127 changes: 127 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
import java.io.FileInputStream
import java.util.Properties

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.google.services)
alias(libs.plugins.firebase.crashlytics)
alias(libs.plugins.ksp)
}
android {
namespace = "com.lolo.io.onelist"

val versionPropsFile = file("../version.properties")
var versionCodeCI: Int? = null
if (versionPropsFile.canRead()) {
val versionProps = Properties()
versionProps.load(FileInputStream(versionPropsFile))
val v = versionProps["VERSION_CODE"]
versionCodeCI = (versionProps["VERSION_CODE"] as String).toInt()
}


defaultConfig {
multiDexEnabled = true
applicationId = "com.lolo.io.onelist"
compileSdk = 34
minSdk = 23
targetSdk = 34
versionCode = versionCodeCI ?: 19
versionName = "1.4.2"
vectorDrawables.useSupportLibrary = true
}

androidResources {
generateLocaleConfig = true
}

buildFeatures {
viewBinding = true
buildConfig = true
}

signingConfigs {
create("release") {
storeFile = file("keystore.jks")
storePassword = System.getenv("ONELIST_KEYSTORE_PASSWORD")
keyAlias = System.getenv("ONELIST_KEYSTORE_ALIAS")
keyPassword = System.getenv("ONELIST_KEYSTORE_ALIAS_PASSWORD")
}
}

ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}

buildTypes {
getByName("debug") {
applicationIdSuffix = ".debug"
versionNameSuffix = "-DEBUG"
resValue("string", "app_name", "1ListDev")
}
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true

proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
resValue("string", "app_name", "1List")
signingConfig = signingConfigs.getByName("release")
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

}
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}

dependencies {

// android
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.preference.ktx)
implementation(libs.androidx.lifecycle.extensions)
implementation(libs.androidx.legacy.support.v4)
implementation(libs.androidx.appcompat)

// android - design
implementation(libs.constraint.layout)
implementation(libs.androidx.recyclerview)
implementation(libs.flexbox)
implementation(libs.material)
implementation(libs.androidx.swiperefreshlayout)

// kotlin
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlin.stdlib.jdk7)

// firebase
implementation(libs.firebase.crashlytics)

// koin di
implementation(libs.koin.android)
implementation(libs.koin.androidx.navigation)

// room
implementation(libs.androidx.room.runtime)
implementation(libs.androidx.room.ktx)
ksp(libs.androidx.room.compiler)

// json
implementation(libs.gson)

// other libs
implementation(libs.whatsnew)
implementation(libs.storage)
implementation(libs.advrecyclerview)
}
Binary file added app/keystore.jks
Binary file not shown.
1 change: 1 addition & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-dontwarn com.fasterxml.jackson.core.**
-dontwarn com.google.common.annotations.**
-dontwarn javax.ws.rs.**
-dontwarn javax.annotation.**
-dontwarn org.immutables.value.**

# R8 GSON special rules :
Expand Down
Loading
Loading