Skip to content

fix(build): stamp release tag into BSD binary version#14

Merged
kjake merged 1 commit into
customizationsfrom
fix/stamp-release-version
Jul 24, 2026
Merged

fix(build): stamp release tag into BSD binary version#14
kjake merged 1 commit into
customizationsfrom
fix/stamp-release-version

Conversation

@kjake

@kjake kjake commented Jul 24, 2026

Copy link
Copy Markdown
Owner

What

Pass VERSION="<release tag>" to gmake cloudflared in all three BSD build steps, so the binary's main.Version is the real release version instead of a git commit SHA.

Why

cloudflared --version on the BSD builds was reporting a bare SHA:

cloudflared version a83dfa20 (built 2026-07-24-1718 UTC)

instead of the release version, so a user can't tell which release they're running. Older releases were correct:

cloudflared version 2025.9.1 (built 2025-09-22-1419 UTC)

Root cause

The Makefile derives the version from git:

VERSION := $(shell git describe --tags --always --match "[0-9][0-9][0-9][0-9].*.*")

build_unix.yaml builds 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 time git describe finds 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

  • YAML validates; all three build steps stamp VERSION.
  • Re-dispatch build_unix.yaml for 2026.7.3 and confirm cloudflared --version reports 2026.7.3 (this PR is used to re-release the current binaries).

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").
@kjake
kjake merged commit dccaf3a into customizations Jul 24, 2026
3 checks passed
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