ci: auto-derive versionCode from commit count (never reuse a code)
Some checks failed
build-apk / build-and-publish (push) Successful in 8m58s
gitleaks / scan (push) Failing after 1s

Releases were silently no-op'ing on fdroid: versionCode was a hand-maintained
constant, so a commit that didn't bump it rebuilt the same debug_<vc>.apk, the
publish receiver's anti-downgrade guard refused the duplicate (exit 3 =
"nothing to do"), and the CI went green having shipped nothing. build.yml now
patches ProjectConfig's versionCode from `git rev-list --count HEAD` (minus an
offset keeping it continuous with the manual era, last=91) before assembling,
so every main commit auto-produces a new monotonic code. The ProjectConfig
literal is now just the local-dev default.
This commit is contained in:
Cobb 2026-07-29 07:23:23 -07:00
parent 71155b32b9
commit 574a8183d4
2 changed files with 23 additions and 0 deletions

View file

@ -359,6 +359,10 @@ const val STRAW_SDK_TARGET = 35
// vc=19 / 0.1.0-AE — rust pipeline cutover. Extraction via
// strawcore-core (Sulkta-OSS/strawcore) via the UniFFI wrapper; no
// NewPipeExtractor in the runtime path.
// versionCode is AUTO-DERIVED in CI from the git commit count (see
// .forgejo/workflows/build.yml "Auto versionCode from commit count") so a
// release can never silently reuse a code. This literal is the local-dev
// default only; CI overwrites it at build time.
const val STRAW_VERSION_CODE = 92
const val STRAW_VERSION_NAME = "0.1.0-CZ"
const val STRAW_APPLICATION_ID = "com.sulkta.straw"