Repository navigation
fix(release): publish patches from git tags - #3338
pratap0007 wants to merge 2 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/retest |
There was a problem hiding this comment.
🟡 Changes recommended
Legacy VERSION files still override detected tags, causing Make builds to embed outdated client versions.
1 open finding
What changed in this PR
Moves patch releases toward tag-based versioning without updating protected maintenance branches.
Changes:
- Stops committing VERSION during releases.
- Adds git-derived version fallback for Make builds.
- Selects patch numbers from the highest existing tag and pushes version-specific branches.
| File | Description |
|---|---|
tekton/release.sh |
Removes VERSION updates and release commits. |
Makefile |
Adds git-tag fallback for client version injection. |
.github/workflows/patch-release.yaml |
Updates patch numbering and tag/branch publication. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
/retest |
| else ifneq (,$(wildcard ./VERSION)) | ||
| VERSIONLDFLAG := -X github.com/tektoncd/cli/pkg/cmd/version.clientVersion=$(shell cat VERSION) |
|
@pratap0007 can we also delete those VERSION files from the release branches as well? I don't think it is required anymore. |
Swap version detection priority in Makefile to check GIT_VERSION first, falling back to VERSION file only when no git tag exists. Priority order: GIT_VERSION → VERSION file → RELEASE_VERSION Signed-off-by: pratap0007 <shverma@redhat.com> Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Release source archives downloaded from GitHub don't contain .git metadata, causing version detection to fail. Add git's export-subst mechanism to preserve tag information in archives. Creates .git_archival.txt with a $Format:%D$ placeholder that git-archive expands to include tag names. The Makefile now extracts the version from this file when git commands fail, ensuring correct version reporting when building from archives. Fixes: tektoncd#3338 (comment) Signed-off-by: pratap0007 <shverma@redhat.com> Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
|
||
| # Extract version from .git_archival.txt (populated by git-archive export-subst) | ||
| ARCHIVE_VERSION := $(shell if [ -f .git_archival.txt ]; then \ | ||
| sed -n 's/^ref-names:.*tag: v\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/p' .git_archival.txt | head -n1; \ |
|
/retest |
@divyansh42 should we delete later once patch release automation has been fixed? |
Sure |

Stop patch releases from committing VERSION and pushing the protected release-vX.Y.x branch. Tag the branch tip, push release-vX.Y.Z, and choose the next patch from the highest existing tag so an unmerged tag is not reused. make still injects clientVersion from ldflags.
Assisted-by: Grok 4.7 (via Cursor)
Changes
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make checkmake generatedSee the contribution guide
for more details.
Release Notes