Skip to content

android: restore computing versionCode at built time - #838

Merged
kari-ts merged 1 commit into
mainfrom
kari/computeversionagain
Aug 12, 2026
Merged

android: restore computing versionCode at built time#838
kari-ts merged 1 commit into
mainfrom
kari/computeversionagain

Conversation

@kari-ts

@kari-ts kari-ts commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

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

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>
@kari-ts
kari-ts requested a review from willh-ts August 11, 2026 21:30
@kari-ts
kari-ts merged commit 0867f01 into main Aug 12, 2026
4 checks passed
@kari-ts
kari-ts deleted the kari/computeversionagain branch August 12, 2026 15:19
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.

2 participants