Skip to content

chore(release): derive app version from git tag#30

Open
Xitee1 wants to merge 1 commit into
mainfrom
chore/git-tag-versioning
Open

chore(release): derive app version from git tag#30
Xitee1 wants to merge 1 commit into
mainfrom
chore/git-tag-versioning

Conversation

@Xitee1
Copy link
Copy Markdown
Owner

@Xitee1 Xitee1 commented Apr 18, 2026

Summary

  • versionName and versionCode are now derived from the current git tag rather than hard-coded in app/build.gradle.kts. Releases need only a vMAJOR.MINOR.PATCH[-suffix] tag — no version-bump commit beforehand.
  • On CI tag pushes, GITHUB_REF_NAME is used. Locally, the tag is read from git describe --tags --exact-match HEAD. If HEAD is not on a tag, falls back to 0.0.0-dev / versionCode = 1 so dev builds stay obviously distinct.
  • versionCode schema unchanged: major * 100000 + minor * 1000 + patch * 10.

Test plan

  • Local debug build (no tag) → 0.0.0-dev / versionCode = 1
  • Simulated CI tag v1.2.31.2.3 / versionCode = 102030
  • Simulated CI pre-release tag v1.0.0-beta1.0.0-beta / versionCode = 100000
  • CI passes on this PR

🤖 Generated with Claude Code

Reads versionName/versionCode from GITHUB_REF_NAME on CI tag pushes, or from
`git describe --tags --exact-match HEAD` locally. Falls back to "0.0.0-dev"
(versionCode 1) when no tag is present, so dev builds stay obviously distinct
from real releases.

Removes the need to bump versions in source before each release; the tag is now
the single source of truth.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant