feat(android): auto-publish signed APK and AAR from CI #26

Merged
sirius merged 2 commits from wt/t_87d7245b into main 2026-09-12 04:59:41 +00:00
Owner

Summary

Auto-publish a verified Android APK + SDK AAR whenever main changes android/**. First automated version is v0.1.0 (zero tags → 0.1.0; afterwards patch+1). versionName matches the tag; versionCode is major*10000 + minor*100 + patch (0.1.0 → 100).

Signing (item 2 — preferred path)

Repo-owned PKCS12 keystore, not the debug key. CI reads Forgejo secrets ANDROID_KEYSTORE_BASE64, ANDROID_KEYSTORE_PASSWORD, ANDROID_KEY_ALIAS, ANDROID_KEY_PASSWORD. Local scripts/build-android-local.sh sources ~/.android/onionwire-release.env so laptop and CI APKs share the cert.

  • Keystore lives on disk at ~/.android/onionwire-release.jks (mode 600) — back that file up. Nothing was committed.
  • Cert SHA-256: C7:18:9A:2A:C2:0B:DF:C0:7C:13:CE:55:CF:05:A6:48:64:37:33:D5:E9:90:F3:93:A0:F8:AC:CE:17:DF:6C:62
  • Alias: onionwire. Valid until 2054.
  • CI sets ONIONWIRE_REQUIRE_RELEASE_KEY=true and fails closed if the secret is missing. Local without the env file still debug-signs (with a Gradle warning) so a laptop build installs.

Trigger

.forgejo/workflows/android-release.yml on docker-amd64:

  • push to main with paths: android/**, scripts/build-android-local.sh, the workflow itself
  • workflow_dispatch inputs tag, dry_run
  • workflow_call inputs tag, dry_run (standalone still works; callers should secrets: inherit)
  • concurrency group onionwire-android-release, cancel-in-progress: false
  • Publish via existing scripts/publish-release.sh (read-only). Create-or-join: wait ~60s for the core tag, never move an existing tag, retry publish. dry_run=true builds and checksums only.

dry_run

Dispatching dry_run=true on this branch after open. Run URL + wall-clock + file / unzip -l / sha256sum -c / apksigner verify --print-certs will be edited in once the job finishes.

Known runner constraint: amd64 dind memory limit is 4Gi and runner timeout is 1h. First Arti/NDK compile may OOM (137) or hit the hour. If it does, cheapest fix is raising forgejo-runner-amd64 dind memory (homek8s) — not a debug key fallback.

Scope

Only allowed files. No keystore, no local.properties, no PROTOCOL.md, no core release workflow edits.

## Summary Auto-publish a verified Android APK + SDK AAR whenever `main` changes `android/**`. First automated version is **v0.1.0** (zero tags → 0.1.0; afterwards patch+1). `versionName` matches the tag; `versionCode` is `major*10000 + minor*100 + patch` (0.1.0 → 100). ## Signing (item 2 — preferred path) Repo-owned PKCS12 keystore, **not** the debug key. CI reads Forgejo secrets `ANDROID_KEYSTORE_BASE64`, `ANDROID_KEYSTORE_PASSWORD`, `ANDROID_KEY_ALIAS`, `ANDROID_KEY_PASSWORD`. Local `scripts/build-android-local.sh` sources `~/.android/onionwire-release.env` so laptop and CI APKs share the cert. - Keystore lives on disk at `~/.android/onionwire-release.jks` (mode 600) — **back that file up**. Nothing was committed. - Cert SHA-256: `C7:18:9A:2A:C2:0B:DF:C0:7C:13:CE:55:CF:05:A6:48:64:37:33:D5:E9:90:F3:93:A0:F8:AC:CE:17:DF:6C:62` - Alias: `onionwire`. Valid until 2054. - CI sets `ONIONWIRE_REQUIRE_RELEASE_KEY=true` and fails closed if the secret is missing. Local without the env file still debug-signs (with a Gradle warning) so a laptop build installs. ## Trigger `.forgejo/workflows/android-release.yml` on `docker-amd64`: - `push` to `main` with `paths:` `android/**`, `scripts/build-android-local.sh`, the workflow itself - `workflow_dispatch` inputs `tag`, `dry_run` - `workflow_call` inputs `tag`, `dry_run` (standalone still works; callers should `secrets: inherit`) - `concurrency` group `onionwire-android-release`, `cancel-in-progress: false` - Publish via existing `scripts/publish-release.sh` (read-only). Create-or-join: wait ~60s for the core tag, never move an existing tag, retry publish. `dry_run=true` builds and checksums only. ## dry_run Dispatching `dry_run=true` on this branch after open. Run URL + wall-clock + `file` / `unzip -l` / `sha256sum -c` / `apksigner verify --print-certs` will be edited in once the job finishes. Known runner constraint: amd64 dind memory limit is **4Gi** and runner timeout is **1h**. First Arti/NDK compile may OOM (137) or hit the hour. If it does, cheapest fix is raising `forgejo-runner-amd64` dind memory (homek8s) — not a debug key fallback. ## Scope Only allowed files. No keystore, no `local.properties`, no `PROTOCOL.md`, no core release workflow edits.
feat(android): auto-publish signed APK and AAR from CI
Some checks failed
ci / test (pull_request) Failing after 3m13s
1c4aaefb01
Push to main that touches android/** builds a release APK + SDK AAR on
docker-amd64, verifies size/ABI/signature, and create-or-joins the Forgejo
release. Version is latest v*.*.* patch+1, or v0.1.0 when there are no tags.
Release signing uses repo secrets (ANDROID_KEYSTORE_*), not the debug key.
fix(ci): android-release HTTPS apt mirrors and dry_run input
All checks were successful
ci / test (pull_request) Successful in 7m9s
c8693d2006
dind timed out on http://deb.debian.org:80. Flip sources to HTTPS.
Do not let workflow_call's boolean false clobber dispatch dry_run.
sirius merged commit 4a248f5b73 into main 2026-09-12 04:59:41 +00:00
Sign in to join this conversation.
No reviewers
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
sirius/onionwire!26
No description provided.