mirror of
https://github.com/awfixers-stuff/OwnDroid.git
synced 2026-03-23 19:15:58 +00:00
ci: build signed apk
Co-authored-by: MinoriceOwO <154642983+minoriceowo@users.noreply.github.com>
This commit is contained in:
35
.github/workflows/build.yml
vendored
35
.github/workflows/build.yml
vendored
@@ -26,20 +26,41 @@ jobs:
|
|||||||
- name: Grant execution permission to Gradle Wrapper
|
- name: Grant execution permission to Gradle Wrapper
|
||||||
run: chmod +x gradlew
|
run: chmod +x gradlew
|
||||||
|
|
||||||
- name: Build Debug APK
|
- name: Build APK (testkey)
|
||||||
run: ./gradlew assembleDebug
|
run: ./gradlew build
|
||||||
|
|
||||||
- name: Upload Debug APK
|
- name: Upload Debug APK (testkey)
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: OwnDroid-CI-${{ env.SHORT_SHA }}-debug-testkey.apk
|
name: OwnDroid-CI-${{ env.SHORT_SHA }}-debug-testkey.apk
|
||||||
path: app/build/outputs/apk/debug/app-debug.apk
|
path: app/build/outputs/apk/debug/app-debug.apk
|
||||||
|
|
||||||
- name: Build Release APK
|
- name: Upload Release APK (testkey)
|
||||||
run: ./gradlew assembleRelease
|
|
||||||
|
|
||||||
- name: Upload Release APK
|
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: OwnDroid-CI-${{ env.SHORT_SHA }}-release-testkey.apk
|
name: OwnDroid-CI-${{ env.SHORT_SHA }}-release-testkey.apk
|
||||||
path: app/build/outputs/apk/release/app-release.apk
|
path: app/build/outputs/apk/release/app-release.apk
|
||||||
|
|
||||||
|
- name: Export key
|
||||||
|
env:
|
||||||
|
KEY_BASE64: ${{ secret.KEY_BASE64 }}
|
||||||
|
run: echo $KEY_BASE64 | base64 --decode - > app/signature.jks
|
||||||
|
|
||||||
|
- name: Build APK
|
||||||
|
env:
|
||||||
|
KEYSTORE_PASSWORD: ${{ secret.KEYSTORE_PASSWORD }}
|
||||||
|
KEY_PASSWORD: ${{ secret.KEY_PASSWORD }}
|
||||||
|
KEY_ALIAS: ${{ secret.KEY_ALIAS }}
|
||||||
|
run: ./gradlew build
|
||||||
|
|
||||||
|
- name: Upload Debug APK
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: OwnDroid-CI-${{ env.SHORT_SHA }}-debug-signed.apk
|
||||||
|
path: app/build/outputs/apk/debug/app-debug.apk
|
||||||
|
|
||||||
|
- name: Upload Release APK
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: OwnDroid-CI-${{ env.SHORT_SHA }}-release-signed.apk
|
||||||
|
path: app/build/outputs/apk/debug/app-debug.apk
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,4 +10,5 @@ captures
|
|||||||
app/build
|
app/build
|
||||||
app/release
|
app/release
|
||||||
app/debug
|
app/debug
|
||||||
|
app/signature.jks
|
||||||
.androidide
|
.androidide
|
||||||
|
|||||||
@@ -3,19 +3,24 @@ plugins {
|
|||||||
alias(libs.plugins.kotlin.android)
|
alias(libs.plugins.kotlin.android)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var keyPassword: String? = null
|
||||||
|
var keystorePassword: String? = null
|
||||||
|
var keyAlias: String? = null
|
||||||
|
|
||||||
android {
|
android {
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
create("testkey") {
|
create("testkey") {
|
||||||
storeFile = file("testkey.jks")
|
storeFile = file("signature.jks")
|
||||||
storePassword = "testkey"
|
storePassword = keystorePassword ?: "testkey"
|
||||||
keyPassword = "testkey"
|
keyPassword = keyPassword ?: "testkey"
|
||||||
keyAlias = "testkey"
|
keyAlias = keyAlias ?: "testkey"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
namespace = "com.bintianqi.owndroid"
|
namespace = "com.bintianqi.owndroid"
|
||||||
compileSdk = 34
|
compileSdk = 34
|
||||||
|
|
||||||
lint.checkReleaseBuilds = false
|
lint.checkReleaseBuilds = false
|
||||||
|
lint.disable += "All"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "com.bintianqi.owndroid"
|
applicationId = "com.bintianqi.owndroid"
|
||||||
@@ -68,6 +73,35 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gradle.taskGraph.whenReady {
|
||||||
|
project.tasks.findByPath(":app:test")?.enabled = false
|
||||||
|
project.tasks.findByPath(":app:lint")?.enabled = false
|
||||||
|
project.tasks.findByPath(":app:lintAnalyzeDebug")?.enabled = false
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.findByName("preBuild")?.dependsOn?.plusAssign("prepareSignature")
|
||||||
|
|
||||||
|
tasks.register("prepareSignature") {
|
||||||
|
doFirst {
|
||||||
|
file("signature.jks").let {
|
||||||
|
if(!it.exists()) file("testkey.jks").copyTo(it)
|
||||||
|
}
|
||||||
|
keystorePassword = System.getenv("KEYSTORE_PASSWORD")
|
||||||
|
keyAlias = System.getenv("KEY_ALIAS")
|
||||||
|
keyPassword = System.getenv("KEY_PASSWORD")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.findByName("clean")?.dependsOn?.plusAssign("cleanKey")
|
||||||
|
|
||||||
|
tasks.register("cleanKey") {
|
||||||
|
doFirst {
|
||||||
|
file("signature.jks").let {
|
||||||
|
if(it.exists()) it.delete()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(libs.androidx.activity.compose)
|
implementation(libs.androidx.activity.compose)
|
||||||
implementation(libs.androidx.ui)
|
implementation(libs.androidx.ui)
|
||||||
|
|||||||
Reference in New Issue
Block a user