From a403bdea619b7a06ea7e556e941cfbf48e7d23fc Mon Sep 17 00:00:00 2001 From: soraefir Date: Sat, 23 Mar 2024 13:50:35 +0100 Subject: [PATCH] CI testing --- .github/workflows/build.yml | 44 +++++++++++++++++++++++++++++++++++++ .gitignore | 2 ++ app/build.gradle | 22 +++++++++++++++---- 3 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..87bb898 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,44 @@ + +name: CI-Android APK + +env: + main_project_module: app + playstore_name: KeepassFidelity + +on: + push: + branches: [ release ] + pull_request: + branches: [ release ] + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: gradle/wrapper-validation-action@v1 + + - name: create and checkout branch + if: github.event_name == 'pull_request' + env: + BRANCH: ${{ github.head_ref }} + run: git checkout -B "$BRANCH" + + - name: set up JDK + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: "temurin" + cache: 'gradle' + + - name: Build APK + run: ./gradlew assemble + + - name: Upload APK + uses: actions/upload-artifact@v4 + with: + name: app + path: app/build/release/apk/release/*.apk \ No newline at end of file diff --git a/.gitignore b/.gitignore index efae956..f0b8517 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ local.properties/ .DS_Store build/ app/build/ +app/debug/ +app/release/ captures/ .externalNativeBuild .cxx diff --git a/app/build.gradle b/app/build.gradle index eddd490..f475d2f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,6 +11,7 @@ android { defaultConfig { applicationId 'net.helcel.fidelity' + resValue "string", "app_name", "Keepass Fideity" minSdk 28 targetSdk 34 versionCode 1 @@ -18,18 +19,29 @@ android { } buildTypes { + debug { + debuggable true + } release { - minifyEnabled false + minifyEnabled true + shrinkResources false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } + + compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + coreLibraryDesugaringEnabled true + + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + encoding 'utf-8' } + kotlinOptions { - jvmTarget = '1.8' + jvmTarget = JavaVersion.VERSION_17 } + buildFeatures { viewBinding true } @@ -37,6 +49,8 @@ android { dependencies { + + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.4' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.12.0' implementation 'androidx.preference:preference-ktx:1.2.1'