From 74fdfcd9d61045d278ff5d928630d644db54f708 Mon Sep 17 00:00:00 2001 From: Zongle Wang Date: Thu, 6 Jun 2024 18:20:46 +0800 Subject: [PATCH 1/2] Add a GHA config to validate builds on CI Validate builds for PRs and pushes on master. --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..faf858c3d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: 17 + - uses: gradle/actions/setup-gradle@v3 + with: + gradle-home-cache-cleanup: true + - run: ./gradlew app:assembleDebug From c3e296145387f486748957a88078685385bc4859 Mon Sep 17 00:00:00 2001 From: Goooler Date: Thu, 6 Jun 2024 18:31:39 +0800 Subject: [PATCH 2/2] Fix release signing key loading --- app/build.gradle.kts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index dd3554d6a..c403e9a46 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -32,8 +32,8 @@ android { } } - signingConfigs { - create("release") { + val releaseSigning = try { + signingConfigs.create("release") { val properties = Properties().apply { load(project.rootProject.file("local.properties").inputStream()) } @@ -42,13 +42,15 @@ android { keyAlias = properties["key.alias"] as String keyPassword = properties["key.password"] as String } + } catch (_: Exception) { + signingConfigs["debug"] } buildTypes { getByName("release") { isMinifyEnabled = true isShrinkResources = true - signingConfig = signingConfigs.getByName("release") + signingConfig = releaseSigning proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" @@ -58,6 +60,7 @@ android { getByName("debug") { versionNameSuffix = "-debug" applicationIdSuffix = ".debug" + signingConfig = releaseSigning isDebuggable = true }