Skip to content

feat: Derive baked-in version from git tag instead of hardcoding#74

Merged
jrosskopf merged 1 commit into
mainfrom
feature/version-from-git-tag
Jun 13, 2026
Merged

feat: Derive baked-in version from git tag instead of hardcoding#74
jrosskopf merged 1 commit into
mainfrom
feature/version-from-git-tag

Conversation

@jrosskopf

Copy link
Copy Markdown
Contributor

Summary

  • Telemetry app_version (and flapi --version) always reported 0.3.0 — the hardcoded project() version — while real releases use CalVer tags (e.g. v26.06.11). The tag only flowed into the PyPI wheel name, never into the binary.
  • CMake now resolves the baked-in FLAPI_VERSION from the git tag, with sensible fallbacks; CI injects the tag on release builds.

Changes

  • CMakeLists.txt: resolve FLAPI_VERSION in priority order — (1) -DFLAPI_VERSION_OVERRIDE (CI from tag), (2) git describe --tags --dirty (local dev), (3) "latest" (source tarball / no git). Leading v stripped → clean semver.
  • Makefile: forward $(CMAKE_EXTRA_FLAGS) on the macOS release-x86_64 / release-arm64 targets (the generic release target already did).
  • build.yaml: on v* tag pushes, inject -DFLAPI_VERSION_OVERRIDE=${{ github.ref_name }} across Windows, Linux (via docker run -e), and macOS builds.

Test plan

  • Validated all three resolution paths in isolation with cmake -P (override → 0.4.0, no-override → 26.06.11-dirty, empty override → falls back).
  • CI build passes on all four platforms.
  • After release, confirm PostHog app_version matches the tag.

🤖 Generated with Claude Code

- Telemetry app_version and `flapi --version` were always "0.3.0" (the
  hardcoded project() version), while real releases use CalVer tags
  (v26.06.11). The tag only flowed into the wheel name, never the binary.
- CMakeLists.txt now resolves FLAPI_VERSION in priority order:
  1. -DFLAPI_VERSION_OVERRIDE (CI sets this from the git tag)
  2. `git describe --tags --dirty` (meaningful local dev versions)
  3. "latest" (fallback: source tarball / no git)
  A leading "v" is stripped so the binary reports clean semver.
- Makefile: forward $(CMAKE_EXTRA_FLAGS) on the macOS release-x86_64 /
  release-arm64 targets (release already forwarded it).
- build.yaml: on tag pushes, inject -DFLAPI_VERSION_OVERRIDE from
  github.ref_name across Windows, Linux (docker -e), and macOS builds.
@jrosskopf jrosskopf merged commit 5f62437 into main Jun 13, 2026
21 checks passed
@jrosskopf jrosskopf deleted the feature/version-from-git-tag branch June 13, 2026 09:14
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