CI: an installable test APK on every push; a beta tag is a pre-release
CI / check (push) Canceled after 0s
CI / check (push) Canceled after 0s
Debug builds are signed with a public test key committed as app/test-debug.keystore (standard debug passwords, .debug application id only). A runner's own debug key is new each run, so every test build used to need the one before it uninstalled -- and a sign-in with it. The version name carries GITHUB_RUN_NUMBER (1.0.0-beta.1-debug.42), and the updater compares only what is before "-debug". ci.yml uploads llembas-android-debug-<run> with the full and fdroid debug APKs named by run and commit, and their SHA256SUMS. release.yml passes --prerelease for a tag with a suffix: beta.1's GitHub Release had to be marked by hand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
8 files changed
+49
-5
No files matched your search
@@ -47,10 +47,21 @@ jobs:
|
||||
run: ./gradlew --no-daemon lintFullDebug
|
||||
continue-on-error: true
|
||||
|
||||
# The test build a tester installs (Actions › this run › Artifacts): debug-signed with the
|
||||
# repository's public test key, so each one installs over the last. `full` is the one to
|
||||
# use; `fdroid` is the same app without the updater.
|
||||
- name: Name the test builds
|
||||
run: |
|
||||
mkdir test-builds
|
||||
short="${GITHUB_SHA::7}"
|
||||
cp app/build/outputs/apk/full/debug/app-full-debug.apk "test-builds/llembas-android-debug-$GITHUB_RUN_NUMBER-$short.apk"
|
||||
cp app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk "test-builds/llembas-android-debug-$GITHUB_RUN_NUMBER-$short-fdroid.apk"
|
||||
(cd test-builds && sha256sum *.apk > SHA256SUMS)
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: llembas-android-debug
|
||||
path: app/build/outputs/apk/*/debug/*.apk
|
||||
name: llembas-android-debug-${{ github.run_number }}
|
||||
path: test-builds/
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
|
||||
@@ -73,4 +73,7 @@ jobs:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
git tag -l --format='%(contents)' "$TAG" | sed '/-----BEGIN SSH SIGNATURE-----/,$d' > notes.md
|
||||
gh release create "$TAG" --verify-tag --title "LLeMbas for Android $VERSION" --notes-file notes.md dist/*
|
||||
# A `-beta.N` tag is a pre-release: never "Latest", never what /releases/latest hands out.
|
||||
pre=""
|
||||
case "$TAG" in *-*) pre="--prerelease" ;; esac
|
||||
gh release create "$TAG" --verify-tag $pre --title "LLeMbas for Android $VERSION" --notes-file notes.md dist/*
|
||||
@@ -8,6 +8,8 @@ local.properties
|
||||
# A release key never goes in the repository (CI writes it from secrets)
|
||||
*.jks
|
||||
*.keystore
|
||||
# ...except the public test key debug builds are signed with (see app/build.gradle.kts)
|
||||
!/app/test-debug.keystore
|
||||
# IDEs
|
||||
.idea/
|
||||
*.iml
|
||||
|
||||
@@ -5,8 +5,16 @@ is in alpha and releases come off `main`.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- **Test builds for every change**: each push to `dev` leaves an installable APK on the CI run,
|
||||
signed with a public test key so a newer test build installs over an older one. The version
|
||||
in Settings › About carries the run's number.
|
||||
|
||||
### Changed
|
||||
|
||||
- A beta (`vX.Y.Z-beta.N`) is published on GitHub as a pre-release by itself.
|
||||
|
||||
- **Pinned to LLeMbas server 2.0.0-beta.4**: the contract, the theme and the strings come from that
|
||||
release. Nothing a person sees changes; the server's API is the same as in beta.1.
|
||||
|
||||
|
||||
@@ -20,6 +20,13 @@ and check it against `SHA256SUMS`. The `full` APK updates itself from llembas.eu
|
||||
one does not. Android 10 or newer; the instance must run LLeMbas server 2.0 or newer (an older
|
||||
one is refused at sign-in, with a sentence saying so).
|
||||
|
||||
**Test builds.** Every push to `dev` builds a debug APK: open the newest green run under
|
||||
[Actions](https://github.com/LLeMbas/LLeMbas-Android/actions/workflows/ci.yml), download the
|
||||
`llembas-android-debug-N` artifact (GitHub asks you to be signed in), unzip it and install the APK that does
|
||||
not end in `-fdroid`. It is a separate app ("eu.llembas.android.debug") beside a released one,
|
||||
signed with a public test key kept in this repository, so each test build installs over the one
|
||||
before it -- and anyone could sign one, so take test builds only from this repository's runs.
|
||||
|
||||
If your instance uses a certificate from your own certificate authority, install that CA on the
|
||||
phone first (Settings › Security › Encryption & credentials › Install a certificate › CA
|
||||
certificate). The app trusts CAs you installed, as the browser does.
|
||||
|
||||
+14
-1
@@ -39,6 +39,17 @@ android {
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
// Debug builds are signed with a *public* test key that lives in the repository, so the
|
||||
// APK every CI run uploads installs over the one before it (a runner's own debug key is
|
||||
// new each run, and Android refuses an update from a different signer). It signs only
|
||||
// the `.debug` application id, never a release, and it is no secret: anyone can sign
|
||||
// with it, so install a debug build only from this repository's CI.
|
||||
getByName("debug") {
|
||||
storeFile = file("test-debug.keystore")
|
||||
storePassword = "android"
|
||||
keyAlias = "androiddebugkey"
|
||||
keyPassword = "android"
|
||||
}
|
||||
releaseKey?.let { key ->
|
||||
create("release") {
|
||||
storeFile = file(key.getProperty("file"))
|
||||
@@ -58,7 +69,9 @@ android {
|
||||
}
|
||||
debug {
|
||||
applicationIdSuffix = ".debug"
|
||||
versionNameSuffix = "-debug"
|
||||
// CI's run number, so a tester can tell two test builds apart in Settings › About.
|
||||
versionNameSuffix = "-debug" + (System.getenv("GITHUB_RUN_NUMBER")?.let { ".$it" } ?: "")
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class Updater(private val context: Context) {
|
||||
if (!it.isSuccessful) return@withContext context.getString(R.string.update_unreachable)
|
||||
LembasJson.decodeFromString(Latest.serializer(), it.body!!.string())
|
||||
}
|
||||
if (!newer(latest.version, BuildConfig.VERSION_NAME.removeSuffix("-debug"))) {
|
||||
if (!newer(latest.version, BuildConfig.VERSION_NAME.substringBefore("-debug"))) {
|
||||
return@withContext context.getString(R.string.update_none)
|
||||
}
|
||||
if (!context.packageManager.canRequestPackageInstalls()) {
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user