Add \$VERSION to FreeNAS.pm; use it as authoritative version in CI
our \$VERSION = '2.3.0' is now the single source of truth for the release series. The build.yml extracts it with a perl one-liner (no module load, no stubs needed) and uses it as BASE_VERSION for alpha/beta channel builds. Git tags remain the release trigger: pushing an exact vX.Y.Z tag publishes to the stable Cloudsmith channel. A mismatch warning fires if the tag version and \$VERSION disagree, catching forgotten version bumps. The v2.3.0-pre anchor tag approach is superseded by this; the anchor tag can stay in history as a breadcrumb but \$VERSION is now what drives builds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ccdc7a43f6
commit
7fa3ff9c91
|
|
@ -111,11 +111,10 @@ jobs:
|
|||
REF="${{ github.ref }}"
|
||||
IS_RELEASE="false"
|
||||
|
||||
# Base version: nearest ancestor v* tag, stripping the 'v' prefix and any
|
||||
# pre-release suffix (e.g. v2.3.0-pre → 2.3.0). This lets us use anchor
|
||||
# tags like v2.3.0-pre to set the version series without triggering a release.
|
||||
BASE_VERSION="$(git describe --tags --match 'v*' --abbrev=0 2>/dev/null \
|
||||
| sed 's/^v//' | sed 's/[^0-9.].*$//' || echo '0.0.0')"
|
||||
# Base version from our $VERSION in FreeNAS.pm — the single source of truth.
|
||||
# Bump that variable when starting a new release series; git tags trigger publishing.
|
||||
BASE_VERSION="$(perl -ne 'if (/our\s+\$VERSION\s*=\s*['"'"'"]([^'"'"'"]+)/) { print $1; exit }' \
|
||||
perl5/PVE/Storage/LunCmd/FreeNAS.pm 2>/dev/null || echo '0.0.0')"
|
||||
|
||||
# Only an exact vX.Y.Z tag (no suffix) is a stable release.
|
||||
if [[ "$REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
|
|
@ -123,6 +122,9 @@ jobs:
|
|||
CHANNEL="stable"
|
||||
CLOUDSMITH_REPO="truenas-proxmox"
|
||||
IS_RELEASE="true"
|
||||
if [[ "$VERSION" != "$BASE_VERSION" ]]; then
|
||||
echo "::warning::Tag version ($VERSION) does not match \$VERSION in FreeNAS.pm ($BASE_VERSION)"
|
||||
fi
|
||||
|
||||
elif [[ "$REF" == refs/heads/master ]]; then
|
||||
VERSION="${BASE_VERSION}-beta+${SHORT_SHA}"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package PVE::Storage::LunCmd::FreeNAS;
|
||||
|
||||
our $VERSION = '2.3.0';
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Data::Dumper;
|
||||
|
|
|
|||
Loading…
Reference in New Issue