ci: build signed debug and release next builds on every main push

Commit a public debug keystore and point the debug signing config at it,
and add a next build type (release-like, same key). Both carry the .next
application id, so next builds install alongside the release and update
each other without exposing the release key. A GitHub workflow builds
both APKs on every push to main and uploads them as artifacts.
This commit is contained in:
austinried
2026-10-08 18:52:43 +00:00
parent f506ac0410
commit 23911fceb5
3 changed files with 54 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
name: Build Next
on:
push:
branches: [main]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
- name: Set up Android SDK
uses: android-actions/setup-android@v4
- name: Install platform and build tools
run: sdkmanager "platforms;android-37" "build-tools;37.0.0"
- name: Build next builds
run: |
chmod +x gradlew
./gradlew :app:assembleDebug :app:assembleNext --no-daemon
- name: Collect next builds
run: |
cp app/build/outputs/apk/debug/app-debug.apk subtracks-next-debug.apk
cp app/build/outputs/apk/next/app-next.apk subtracks-next.apk
- name: Upload next builds
uses: actions/upload-artifact@v4
with:
name: subtracks-next
path: |
subtracks-next-debug.apk
subtracks-next.apk
+15
View File
@@ -80,6 +80,13 @@ android {
.add("src/integrationTest/kotlin")
signingConfigs {
// Committed on purpose: a public key for debug and next builds, never for distribution.
getByName("debug") {
storeFile = file("debug.keystore")
storePassword = "android"
keyAlias = "androiddebugkey"
keyPassword = "android"
}
val keystorePath = providers.environmentVariable("RELEASE_KEYSTORE").orNull
if (keystorePath != null) {
create("release") {
@@ -92,6 +99,9 @@ android {
}
buildTypes {
debug {
applicationIdSuffix = ".next"
}
release {
isMinifyEnabled = true
isShrinkResources = true
@@ -99,6 +109,11 @@ android {
// Release signing when the keystore is supplied (CI); debug elsewhere so local build/install works.
signingConfig = signingConfigs.findByName("release") ?: signingConfigs.getByName("debug")
}
create("next") {
initWith(getByName("release"))
applicationIdSuffix = ".next"
signingConfig = signingConfigs.getByName("debug")
}
}
}
Binary file not shown.