ci: fix versioning — stable uses -1 revision, pre-releases use ~ prefix
Stable releases now produce X.Y.Z-1 (e.g. 2.3.0-1) so they sort higher than any pre-release build in dpkg. Pre-release builds now use tilde (~beta+sha, ~alpha+sha) which sorts below the base version, ensuring apt upgrade always selects stable over a previously installed beta. Previously -beta+sha sorted higher than X.Y.Z causing apt to refuse upgrades from beta to stable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
aa617cf788
commit
a0d0285194
|
|
@ -117,27 +117,31 @@ jobs:
|
||||||
perl5/PVE/Storage/LunCmd/FreeNAS.pm 2>/dev/null || echo '0.0.0')"
|
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.
|
# Only an exact vX.Y.Z tag (no suffix) is a stable release.
|
||||||
|
# Stable packages use a "-1" Debian revision so they sort higher than
|
||||||
|
# any pre-release build (e.g. 2.3.0~beta+sha < 2.3.0-1).
|
||||||
|
# Pre-release builds use "~" (tilde) which sorts BELOW the base version
|
||||||
|
# in dpkg, ensuring stable always wins on apt upgrade.
|
||||||
if [[ "$REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
if [[ "$REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
VERSION="${REF#refs/tags/v}"
|
VERSION="${REF#refs/tags/v}-1"
|
||||||
CHANNEL="stable"
|
CHANNEL="stable"
|
||||||
CLOUDSMITH_REPO="truenas-proxmox"
|
CLOUDSMITH_REPO="truenas-proxmox"
|
||||||
IS_RELEASE="true"
|
IS_RELEASE="true"
|
||||||
if [[ "$VERSION" != "$BASE_VERSION" ]]; then
|
if [[ "${REF#refs/tags/v}" != "$BASE_VERSION" ]]; then
|
||||||
echo "::warning::Tag version ($VERSION) does not match \$VERSION in FreeNAS.pm ($BASE_VERSION)"
|
echo "::warning::Tag version (${REF#refs/tags/v}) does not match \$VERSION in FreeNAS.pm ($BASE_VERSION)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [[ "$REF" == refs/heads/master ]]; then
|
elif [[ "$REF" == refs/heads/master ]]; then
|
||||||
VERSION="${BASE_VERSION}-beta+${SHORT_SHA}"
|
VERSION="${BASE_VERSION}~beta+${SHORT_SHA}"
|
||||||
CHANNEL="testing"
|
CHANNEL="testing"
|
||||||
CLOUDSMITH_REPO="truenas-proxmox-testing"
|
CLOUDSMITH_REPO="truenas-proxmox-testing"
|
||||||
|
|
||||||
elif [[ "$REF" == refs/heads/feature_* ]]; then
|
elif [[ "$REF" == refs/heads/feature_* ]]; then
|
||||||
VERSION="${BASE_VERSION}-alpha+${SHORT_SHA}"
|
VERSION="${BASE_VERSION}~alpha+${SHORT_SHA}"
|
||||||
CHANNEL="development"
|
CHANNEL="development"
|
||||||
CLOUDSMITH_REPO="truenas-proxmox-snapshots"
|
CLOUDSMITH_REPO="truenas-proxmox-snapshots"
|
||||||
|
|
||||||
else
|
else
|
||||||
VERSION="${BASE_VERSION}-dev+${SHORT_SHA}"
|
VERSION="${BASE_VERSION}~dev+${SHORT_SHA}"
|
||||||
CHANNEL="none"
|
CHANNEL="none"
|
||||||
CLOUDSMITH_REPO=""
|
CLOUDSMITH_REPO=""
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue