feat(android): versioned Forgejo releases (android-v* + changelog + workflow) #1187

Merged
chris merged 1 commit from feat/android-releases into main 2026-10-13 09:42:54 +02:00
Owner

Summary

Versions and releases the Android app like wishlist-nextcloud: every android-vX.Y.Z tag now produces a visible, separately-named Forgejo release at https://git.wiwie.dk/chris/memories/releases with German release notes and a fingerprint-gated APK.

apps/android/app/build.gradle.kts

  • versionName 0.4.2 → 0.5.0.
  • The manual versionCode = 17 ledger (1 = 0.1.0 … 17 = 0.4.2) is replaced by a wishlist-style derivation major*1_000_000 + minor*1_000 + patch → 5000 (monotonic, > 17). The versionName line is the single version source read by the release workflow.
  • New: signingConfigs.release wired to the stable debug keystore at $HOME/.android/debug.keystore (AGP's public debug credentials; the file itself comes from the ANDROID_DEBUG_KEYSTORE_BASE64 secret). Without this, assembleRelease emits an unsigned APK and the fingerprint gate could never pass. Falls back to the debug signingConfig when the keystore file is absent (local builds).

apps/android/CHANGELOG.md (new)

Keep-a-Changelog, German, same preamble contract as wishlist's (adapted: workflow path .forgejo/workflows/android-release.yml, tags android-vX.Y.Z, header ## [X.Y.Z]). First section: [0.5.0] - 2026-10-13 (Fotos neben der Karte / Schärfere Personenbilder).

.forgejo/workflows/android-release.yml (new, purely additive)

Adapted from wishlist's release.yml, deliberately different where memories requires it:

  • Trigger android-v* (v* stays the server-release namespace); strips the android-v prefix.
  • runs-on: memories-deploy + gradle:8.13-jdk21 container, ANDROID_HOME/GRADLE_USER_HOME on /home/chris/git/.ci-cache/*, heavy-test lock around SDK/Gradle steps, Node 20 install — same pattern as the existing android job in build-deploy.yml.
  • Checkout via the changes-job mirror pattern (full history + tags, wishlist's fetch-depth: 0 equivalent) so the git-log notes fallback works.
  • Version gate: tag android-vX.Y.Z must equal versionName parsed from build.gradle.kts (fail hard).
  • Release build signed with the stable debug identity, apksigner verify gated on SHA-256 3be7737d…aebec (fail hard on mismatch/unsigned — same rationale as build-deploy.yml).
  • Release notes: prefer the ## [X.Y.Z] section from apps/android/CHANGELOG.md (tolerant awk matcher copied from wishlist); fallback groups git log since the previous android-v tag into Neue Funktionen (feat*/ux*) / Behobene Fehler (fix*) / Sonstiges, excluding release:/spec: subjects; hard-fails on empty notes.
  • Upload via the public REST API https://git.wiwie.dk/api/v1 (NOT the forgejo-release action — ISSUE-069: artifact backend unreachable from host-networked runner containers), mirroring the proven curl pattern from build-deploy.yml's rolling-release step: lookup by tag → create if 404 / reuse if 200, PATCH name+body (notes escaped to JSON via Node), delete old asset, POST memories-android-<version>.apk. Release is not a prerelease, named Memories Android <version>.
  • The rolling android-ci channel in build-deploy.yml is untouched.

Validation

  • ./gradlew :app:compileDebugKotlin :app:testDebugUnitTest --no-daemon → BUILD SUCCESSFUL (pre-existing warnings only).
  • ./gradlew :app:assembleRelease --no-daemon locally → app-release.apk, output-metadata.json shows versionCode: 5000, versionName: "0.5.0"; apksigner reports SHA-256 3be7737d9a07f5d1b91bf63ed40a18befa59fee8537d8dee79d5286a342aebec → fingerprint gate OK.
  • python3 yaml.safe_load on android-release.yml → OK.
  • Notes-extraction simulation TAG=0.5.0 → extracted the 0.5.0 section (not the preamble); version-gate simulation TAG=0.5.0 vs parsed versionName → match.
  • Fallback path exercised with a synthetic TAG=9.9.9 (no changelog section): git-log grouping produced feats/fixes/other buckets with ux(/feat( mapping and release:/spec: exclusions verified.
  • All 9 run: blocks pass sh -n/bash -n (the notes step declares shell: bash for wishlist's bash-isms; everything else stays POSIX sh).
## Summary Versions and releases the Android app like wishlist-nextcloud: every `android-vX.Y.Z` tag now produces a visible, separately-named Forgejo release at https://git.wiwie.dk/chris/memories/releases with German release notes and a fingerprint-gated APK. ### `apps/android/app/build.gradle.kts` - `versionName` 0.4.2 → **0.5.0**. - The manual `versionCode = 17` ledger (1 = 0.1.0 … 17 = 0.4.2) is replaced by a wishlist-style derivation `major*1_000_000 + minor*1_000 + patch` → **5000** (monotonic, > 17). The `versionName` line is the single version source read by the release workflow. - **New:** `signingConfigs.release` wired to the stable debug keystore at `$HOME/.android/debug.keystore` (AGP's public debug credentials; the file itself comes from the `ANDROID_DEBUG_KEYSTORE_BASE64` secret). Without this, `assembleRelease` emits an *unsigned* APK and the fingerprint gate could never pass. Falls back to the debug signingConfig when the keystore file is absent (local builds). ### `apps/android/CHANGELOG.md` (new) Keep-a-Changelog, German, same preamble contract as wishlist's (adapted: workflow path `.forgejo/workflows/android-release.yml`, tags `android-vX.Y.Z`, header `## [X.Y.Z]`). First section: **[0.5.0] - 2026-10-13** (Fotos neben der Karte / Schärfere Personenbilder). ### `.forgejo/workflows/android-release.yml` (new, purely additive) Adapted from wishlist's `release.yml`, deliberately different where memories requires it: - Trigger `android-v*` (`v*` stays the server-release namespace); strips the `android-v` prefix. - `runs-on: memories-deploy` + `gradle:8.13-jdk21` container, `ANDROID_HOME`/`GRADLE_USER_HOME` on `/home/chris/git/.ci-cache/*`, heavy-test lock around SDK/Gradle steps, Node 20 install — same pattern as the existing `android` job in build-deploy.yml. - Checkout via the `changes`-job mirror pattern (full history + tags, wishlist's fetch-depth: 0 equivalent) so the git-log notes fallback works. - Version gate: tag `android-vX.Y.Z` must equal `versionName` parsed from `build.gradle.kts` (fail hard). - Release build signed with the stable debug identity, apksigner verify gated on SHA-256 `3be7737d…aebec` (fail hard on mismatch/unsigned — same rationale as build-deploy.yml). - Release notes: prefer the `## [X.Y.Z]` section from `apps/android/CHANGELOG.md` (tolerant awk matcher copied from wishlist); fallback groups `git log` since the previous `android-v` tag into Neue Funktionen (feat\*/ux\*) / Behobene Fehler (fix\*) / Sonstiges, excluding `release:`/`spec:` subjects; hard-fails on empty notes. - Upload via the public REST API `https://git.wiwie.dk/api/v1` (NOT the forgejo-release action — ISSUE-069: artifact backend unreachable from host-networked runner containers), mirroring the proven curl pattern from build-deploy.yml's rolling-release step: lookup by tag → create if 404 / reuse if 200, PATCH name+body (notes escaped to JSON via Node), delete old asset, POST `memories-android-<version>.apk`. Release is **not** a prerelease, named `Memories Android <version>`. - The rolling `android-ci` channel in build-deploy.yml is untouched. ## Validation - `./gradlew :app:compileDebugKotlin :app:testDebugUnitTest --no-daemon` → **BUILD SUCCESSFUL** (pre-existing warnings only). - `./gradlew :app:assembleRelease --no-daemon` locally → `app-release.apk`, `output-metadata.json` shows `versionCode: 5000, versionName: "0.5.0"`; apksigner reports SHA-256 `3be7737d9a07f5d1b91bf63ed40a18befa59fee8537d8dee79d5286a342aebec` → **fingerprint gate OK**. - `python3 yaml.safe_load` on android-release.yml → OK. - Notes-extraction simulation TAG=0.5.0 → extracted the 0.5.0 section (not the preamble); version-gate simulation TAG=0.5.0 vs parsed versionName → match. - Fallback path exercised with a synthetic TAG=9.9.9 (no changelog section): git-log grouping produced feats/fixes/other buckets with `ux(`/`feat(` mapping and `release:`/`spec:` exclusions verified. - All 9 `run:` blocks pass `sh -n`/`bash -n` (the notes step declares `shell: bash` for wishlist's bash-isms; everything else stays POSIX sh).
feat(android): versioned forgejo releases (android-v* tags, changelog, release workflow)
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 2m20s
Build and Deploy / Android unit tests and debug APK (push) Successful in 4m37s
2429d2ea63
- bump app to 0.5.0 and derive versionCode from versionName
  (major*1_000_000 + minor*1_000 + patch -> 5000), retiring the
  manual 1..17 ledger; wire assembleRelease signing to the stable
  debug keystore so the fingerprint gate can pass
- add apps/android/CHANGELOG.md (Keep-a-Changelog, German) with the
  0.5.0 section; its '## [X.Y.Z]' section is the release-notes source
- add .forgejo/workflows/android-release.yml: on android-v* tags,
  version-gate the tag against versionName, build + fingerprint-gate
  the release APK on the memories-deploy runner (same container/env
  as the existing android job), take notes from the changelog section
  (git-log fallback grouped by conventional type), and publish via the
  public Forgejo REST API (forgejo-release action unusable, ISSUE-069);
  rolling android-ci channel untouched
chris merged commit 2226a9de3f into main 2026-10-13 09:42:54 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!1187
No description provided.