ci(release): auto-release engine (conventional commits) for the APK

Replace the tag-triggered release.yml with link/'s language-agnostic release
engine, adapted for Android. On every push to main it derives the next version
from conventional-commit subjects since the last v* tag (feat!/BREAKING -> major,
feat -> minor, fix|perf -> patch; nothing releasable -> no release), generates a
grouped changelog, bumps versionName in build.gradle.kts (versionCode derived
major*10000+minor*100+patch, monotonic), builds the SIGNED release APK, then
commits the bump [skip ci], tags vX.Y.Z, and creates the Gitea release with the
notes + APK + SHA256SUMS.

Uses REGISTRY_USER/REGISTRY_TOKEN (write:repository) to push the bump + create
the release, matching link/. main must allow that account to push (bump lands on
main; the [skip ci] + head-commit guard prevent a re-trigger loop). Signing
secrets (ANDROID_KEYSTORE_BASE64/_PASSWORD, ANDROID_KEY_ALIAS/_PASSWORD) unchanged.
Same self-hosted-runner handling as pr-checks.yml (apt JDK 17, sdkmanager, chmod).

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-20 04:23:23 -05:00
parent 0df862a6af
commit 68da9da805
2 changed files with 187 additions and 68 deletions

View File

@@ -40,10 +40,10 @@ android {
applicationId = "com.runicgateway.app"
minSdk = 29
targetSdk = 35
// The release workflow drives these from the git tag (versionName) and a
// monotonic CI run number (versionCode) via -P overrides; local/PR builds
// fall back to the committed defaults. Keep the tag as the release's source
// of truth (PLAN.md §10: semantic versionName + monotonic versionCode).
// These committed defaults are the version source of truth (PLAN.md §10).
// release.yml's conventional-commit engine bumps versionName here and commits
// it on release; versionCode is derived from it (major*10000+minor*100+patch)
// so it stays monotonic. Both remain overridable via -P for local/manual builds.
versionCode = (project.findProperty("versionCode") as String?)?.toIntOrNull() ?: 1
versionName = (project.findProperty("versionName") as String?)?.takeIf { it.isNotBlank() } ?: "0.1.0"