feat: derive versionName/versionCode from the v* tag - #21
Merged
Conversation
versionName sat at '0.1.0' for eight releases because nothing forced the bump; the RFC 0016 version line would have shown it. Now the tag is the single source of truth: - versionName = most recent v* tag via git describe (tag builds report the tag exactly; dev builds '0.1.8-3-g1a2b3c4'); constants demoted to no-git fallbacks. - versionCode = 1000 + commit count (deterministic, monotonic, and above every historically shipped code). - release.yml gate: on v* tags, the built APK's versionName must equal the tag or the release fails before publishing. Verified: APK badging shows versionName 0.1.8 / versionCode 1060 on the v0.1.8 commit; simulated dev commit reports 0.1.8-1-g<sha>. Signed-off-by: will wade <willwade@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while cutting v0.1.8:
versionNamehad been stuck at "0.1.0" since inception (manually bumped to 0.1.8 in #20). With RFC 0016's version line now shipped, the tag should be the single source of truth. Companion: Dasher-GTK #56 (same treatment via CMakegit describe).Changes (
app/build.gradle.kts)versionName= most recentv*tag viagit describe --tags --match v*run from the repo root: tag builds report the tag exactly; dev builds report0.1.8-3-g1a2b3c4. The literal constants remain only as no-git (tarball) fallbacks.versionCode= 1000 + commit count (git rev-list --count HEAD) — deterministic, strictly monotonic, and above every historically shipped code (max 8). No more manualversionCodearithmetic.release.yml: onv*tag pushes, the built APK'sversionName(read viaaapt2 dump badging) must equal the tag, else the workflow fails before publishing — a mislabelled APK can never ship.Verified locally
versionName='0.1.8' versionCode='1060'(1000 + 60 commits).0.1.8-1-g457c264.:app:assembleDebuggreen.DCO signed.