mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 07:29:14 +01:00
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:
@@ -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
|
||||||
@@ -80,6 +80,13 @@ android {
|
|||||||
.add("src/integrationTest/kotlin")
|
.add("src/integrationTest/kotlin")
|
||||||
|
|
||||||
signingConfigs {
|
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
|
val keystorePath = providers.environmentVariable("RELEASE_KEYSTORE").orNull
|
||||||
if (keystorePath != null) {
|
if (keystorePath != null) {
|
||||||
create("release") {
|
create("release") {
|
||||||
@@ -92,6 +99,9 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
applicationIdSuffix = ".next"
|
||||||
|
}
|
||||||
release {
|
release {
|
||||||
isMinifyEnabled = true
|
isMinifyEnabled = true
|
||||||
isShrinkResources = true
|
isShrinkResources = true
|
||||||
@@ -99,6 +109,11 @@ android {
|
|||||||
// Release signing when the keystore is supplied (CI); debug elsewhere so local build/install works.
|
// Release signing when the keystore is supplied (CI); debug elsewhere so local build/install works.
|
||||||
signingConfig = signingConfigs.findByName("release") ?: signingConfigs.getByName("debug")
|
signingConfig = signingConfigs.findByName("release") ?: signingConfigs.getByName("debug")
|
||||||
}
|
}
|
||||||
|
create("next") {
|
||||||
|
initWith(getByName("release"))
|
||||||
|
applicationIdSuffix = ".next"
|
||||||
|
signingConfig = signingConfigs.getByName("debug")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user