fix(build): stamp release tag into BSD binary version#14
Merged
Conversation
The BSD build runs while the GitHub release is still a draft, so the git tag (e.g. 2026.7.3) does not exist yet at build time. The Makefile derives main.Version from `git describe --tags`, which then falls back to a bare commit SHA, so `cloudflared --version` reported e.g. "a83dfa20" instead of "2026.7.3" and users could not tell which release they were running. Pass VERSION=<release tag> explicitly to gmake in all three BSD build steps. A command-line VERSION overrides the Makefile's git-describe value in GNU make, so the binary is stamped with the real release version regardless of whether the tag exists at build time. Restores the behavior of older releases (e.g. 2025.9.1 correctly reported "cloudflared version 2025.9.1").
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.
What
Pass
VERSION="<release tag>"togmake cloudflaredin all three BSD build steps, so the binary'smain.Versionis the real release version instead of a git commit SHA.Why
cloudflared --versionon the BSD builds was reporting a bare SHA:instead of the release version, so a user can't tell which release they're running. Older releases were correct:
Root cause
The Makefile derives the version from git:
build_unix.yamlbuilds the binaries while the GitHub release is still a draft. The<tag>git tag isn't created until the publish step, which runs after the build — so at build timegit describefinds no matching tag and falls back (--always) to the short commit SHA. Nothing in the Makefile changed; the pipeline's draft→build→publish ordering is what regressed this versus older releases that were built with the tag already present.Fix
A command-line
VERSION=overrides the Makefile's:=assignment in GNU make, so the git-describe fallback is bypassed entirely and the binary is stamped deterministically — independent of whether the tag exists yet. Uses the same${{ steps.get_release.outputs.tag_name }}that the "Upload build to GitHub Release" step already uses inline.Test plan
VERSION.build_unix.yamlfor2026.7.3and confirmcloudflared --versionreports2026.7.3(this PR is used to re-release the current binaries).