Skip to content

fix: show release tag in version command output#1859

Open
jnMetaCode wants to merge 3 commits intolightpanda-io:mainfrom
jnMetaCode:fix/version-command-show-tag
Open

fix: show release tag in version command output#1859
jnMetaCode wants to merge 3 commits intolightpanda-io:mainfrom
jnMetaCode:fix/version-command-show-tag

Conversation

@jnMetaCode
Copy link
Contributor

Fixes #1835

Problem

lightpanda version always prints the short commit hash (e.g. fe3faa0a), even on stable releases where the tag name (e.g. v0.2.6) would be more useful.

Solution

Add a git_tag build option that release builds can set. When present, the version command prints:

v0.2.6 (fe3faa0a)

When absent (dev/nightly builds), the output is unchanged:

fe3faa0a

Changes

  • build.zig: add git_tag build option, expose it via build_config
  • src/main.zig: prefer tag over bare commit hash in version output
  • build.yml: pass -Dgit_tag=<tag> when the CI build is triggered by a tag push

Add git_tag build option so release builds can pass the tag name.
When available, `lightpanda version` prints the tag (e.g. v0.2.6)
instead of just the commit hash.

Closes lightpanda-io#1835

Signed-off-by: JiangNan <1394485448@qq.com>
When built with -Dgit_tag=v0.2.6, `lightpanda version` now prints:
  v0.2.6 (fe3faa0)
instead of just:
  fe3faa0

Signed-off-by: JiangNan <1394485448@qq.com>
When the build is triggered by a tag push, pass -Dgit_tag to zig build
so the binary can display the release version in `lightpanda version`.

Signed-off-by: JiangNan <1394485448@qq.com>
@github-actions
Copy link

github-actions bot commented Mar 16, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@jnMetaCode
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

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.

version command should return the version number on stable release

1 participant