android: restore computing versionCode at built time - #838
Merged
Conversation
This computes a monotonic, time-based versionCode for each release build instead of stamping it into build.gradle. We use the same base versionCode for phone and Android TV builds, reserving the last digit for the platform. versionCode was originally generated by the release build rather than stored in the repo. We switched to computing versionCode in #807 so that fdroid and Play Store builds would produce the same value, then switched to a literal versionCode in #823 because fdroid's update checking needed the versionCode to be grepable. The literal versionCode approach required bumposs/tag_release to update and commit for fdroid to discover the generated versionCode. This moves versionCode generation back to build time, using a time-based base code so that versionCodes remain globally increasing even when stable releases are cut after higher numbered unstables. fdroid discovery will be handled by android_publisher - when a stable apk is published to pkgs, it will publish a version.txt with the versionCode and versionName extracted from the apk manifest. fdroid will use that file for http update checks, so the versionCode no longer needs to be committed to build.gradle Updates tailscale/tailscale#18969 Signed-off-by: kari-ts <kari@tailscale.com>
willh-ts
approved these changes
Aug 12, 2026
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.
This computes a monotonic, time-based versionCode for each release build instead of stamping it into build.gradle. We use the same base versionCode for phone and Android TV builds, reserving the last digit for the platform.
versionCode was originally generated by the release build rather than stored in the repo. We switched to computing versionCode in #807 so that fdroid and Play Store builds would produce the same value, then switched to a literal versionCode in #823 because fdroid's update checking needed the versionCode to be grepable. The literal versionCode approach required bumposs/tag_release to update and commit for fdroid to discover the generated versionCode. This moves versionCode generation back to build time, using a time-based base code so that versionCodes remain globally increasing even when stable releases are cut after higher numbered unstables. fdroid discovery will be handled by android_publisher - when a stable apk is published to pkgs, it will publish a version.txt with the versionCode and versionName extracted from the apk manifest. fdroid will use that file for http update checks, so the versionCode no longer needs to be committed to build.gradle
Updates tailscale/tailscale#18969