TOOLS-4173 - derive package version from git tags via build/version - #81
Open
pvinh-spike wants to merge 1 commit into
Open
TOOLS-4173 - derive package version from git tags via build/version#81pvinh-spike wants to merge 1 commit into
pvinh-spike wants to merge 1 commit into
Conversation
pvinh-spike
added a commit
to aerospike/aerospike-tools-validation
that referenced
this pull request
Jul 28, 2026
Rework build/version into the single source of truth for versioning, mirroring the aerospike-server resolver, and wire it into deb/rpm packaging. Ported from aerospike/act#81 (adapted for 3-part semver x.y.z). - build/version: -v (bare x.y.z on master, full git-describe with sha on dev branches), -r (build number: first-parent commits since the tag, 0 on the tag; 0 on dev), default (x.y.z-n). Anchors on the bare x.y.z tag via --match '[0-9]*.[0-9]*.[0-9]*' (never a leading-v tag the Debian Version: rejects), falls back to the short sha, and resolves the branch through CI env vars for detached-HEAD checkouts. Replaces the previous describe+awk stub that stripped every build to bare x.y.z (no build number, no dev descriptor). - pkg/Makefile.{deb,rpm}: REV = build/version -v, BUILD_NUMBER = -r + 1 so the tagged release and dev builds are revision 1 and successive master builds are orderable. rpm maps '-' -> '_' in Version (rpm forbids '-'). - pkg/rpm/asvalidation.spec: Release 1 -> @Release@ so the build number reaches rpm. Package names: master on tag asvalidation_2.2.0-1<os>_<arch>.deb asvalidation-2.2.0-1.<dist>.<arch>.rpm dev asvalidation_2.2.0-<n>-g<sha>-1<os> asvalidation-2.2.0_<n>_g<sha>-1.<dist> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4 tasks
pvinh-spike
added a commit
to aerospike/aerospike-tools-validation
that referenced
this pull request
Jul 28, 2026
Rework build/version into the single source of truth for versioning, mirroring the aerospike-server resolver, and wire it into deb/rpm packaging. Ported from aerospike/act#81 (adapted for 3-part semver x.y.z). - build/version: -v (bare x.y.z on master, full git-describe with sha on dev branches), -r (build number, 1-based: first-parent commits since the tag + 1, so the tagged release is 1; dev branches are 1), default (x.y.z-n). Anchors on the bare x.y.z tag via --match '[0-9]*.[0-9]*.[0-9]*' (never a leading-v tag the Debian Version: rejects), falls back to the short sha, and resolves the branch through CI env vars for detached-HEAD checkouts. Replaces the previous describe+awk stub that stripped every build to bare x.y.z (no build number, no dev descriptor). - pkg/Makefile.{deb,rpm}: REV = build/version -v, BUILD_NUMBER = build/version -r, so successive master builds are orderable. rpm maps '-' -> '_' in Version (rpm forbids '-'). - pkg/rpm/asvalidation.spec: Release 1 -> @Release@ so the build number reaches rpm. Package names: master on tag asvalidation_2.2.0-1<os>_<arch>.deb asvalidation-2.2.0-1.<dist>.<arch>.rpm dev asvalidation_2.2.0-<n>-g<sha>-1<os> asvalidation-2.2.0_<n>_g<sha>-1.<dist> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rework build/version into the single source of truth for versioning, mirroring
the aerospike-server resolver, and wire it into deb/rpm packaging.
- build/version: -v (bare x.y on master, full git-describe with sha on dev
branches), -r (build number, 1-based: first-parent commits since the tag + 1,
so the tagged release is 1; dev branches are 1), default (x.y-n). Anchors on
the bare x.y tag via --match '[0-9]*.[0-9]*' (never a leading-v tag the Debian
Version: rejects), falls back to the short SHA, and resolves the branch through
CI env vars for detached-HEAD checkouts.
- pkg/Makefile.{deb,rpm}: REV = build/version -v, BUILD_NUMBER = build/version -r,
so successive master builds are orderable. rpm maps '-' -> '_' in Version
(rpm forbids '-').
- pkg/rpm/act.spec: Release 1 -> @Release@ so the build number reaches rpm.
Package names:
master on tag act_6.7-1<os>_<arch>.deb act-6.7-1.<dist>.<arch>.rpm
dev act_6.7-<n>-g<sha>-1<os> act-6.7_<n>_g<sha>-1.<dist>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pvinh-spike
force-pushed
the
pvinh/update-version-script
branch
from
July 28, 2026 22:55
f6b7e0c to
577f876
Compare
3 tasks
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.
Summary
Makes
build/versionthe single source of truth for act's package versioning and wires it into the deb/rpm Makefiles, so packages are versioned from git tags and successive builds are orderable. Ported from asmt#42 and aligned to the canonical aerospike-server resolver (build/README-VERSIONING.mdthere).Changes
build/version— unified resolver with three modes:build/version -v→ master: barex.y; dev branches: fullgit describe(x.y-<n>-g<sha>)build/version -r→ master: build number (first-parent commits since the tag, 0 on the tag); dev: 0x.y-nAnchors on the bare
x.ytag via--match '[0-9]*.[0-9]*'(never a leading-vtag the DebianVersion:rejects), falls back to the short SHA, and resolves the branch through CI env vars for detached-HEAD checkouts (actions/checkout). Release line ismaster.pkg/Makefile.deb—REV = build/version -v,BUILD_NUMBER = build/version -r + 1; version/revision now consistent between the controlVersion:and the.debfilename.pkg/Makefile.rpm—RPM_VERSION = $(subst -,_,$(REV))(rpm forbids-inVersion:),Release = BUILD_NUMBER.pkg/rpm/act.spec—Release: 1→Release: @RELEASE@%{?dist}so the build number reaches rpm.The
+1makes the tagged release (and dev builds) revision1; unlike aerospike-server, act tags the release commit directly (no line-open marker tag), so-ris0there and the Makefile adds the 1.Resulting package names
act-6.7-1.el8.x86_64.rpmact_6.7-1ubuntu24.04_amd64.debact-6.7-<N+1>.el8…act_6.7-<N+1>ubuntu24.04…act-6.7_9_g489893fb9-1.el8…act_6.7-9-g489893fb9-1ubuntu24.04_amd64.deb(dev rpm uses
_in the describe segment because rpmVersion:cannot contain-.)Note
The package version now comes from git tags, not
src/common/version.h.version.hstill drives the compiled binary's reported version (ACT version …), so between releases a master build's package tracks the last tag while the binary reports version.h.version.his intentionally left unchanged by this PR.Test plan
bash -n build/version; all modes + error paths exercisedGITHUB_REFmake -f pkg/Makefile.{deb,rpm} print-REV/print-BUILD_NUMBERresolve correctly.deb/.rpmnames on a real Linux runner🤖 Generated with Claude Code