diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c6f0b5a..5e9d8b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -111,10 +111,14 @@ jobs: REF="${{ github.ref }}" IS_RELEASE="false" - # Base version from the nearest vX.Y.Z tag (strips the 'v' prefix) - BASE_VERSION="$(git describe --tags --match 'v*' --abbrev=0 2>/dev/null | sed 's/^v//' || echo '0.0.0')" + # 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')" - if [[ "$REF" == refs/tags/v* ]]; then + # 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 VERSION="${REF#refs/tags/v}" CHANNEL="stable" CLOUDSMITH_REPO="truenas-proxmox"