chore(release): derive app version from git tag#30
Open
Xitee1 wants to merge 1 commit into
Open
Conversation
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>
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.
Summary
versionNameandversionCodeare now derived from the current git tag rather than hard-coded inapp/build.gradle.kts. Releases need only avMAJOR.MINOR.PATCH[-suffix]tag — no version-bump commit beforehand.GITHUB_REF_NAMEis used. Locally, the tag is read fromgit describe --tags --exact-match HEAD. If HEAD is not on a tag, falls back to0.0.0-dev/versionCode = 1so dev builds stay obviously distinct.versionCodeschema unchanged:major * 100000 + minor * 1000 + patch * 10.Test plan
0.0.0-dev/versionCode = 1v1.2.3→1.2.3/versionCode = 102030v1.0.0-beta→1.0.0-beta/versionCode = 100000🤖 Generated with Claude Code