From 137d5a5f7c749ad7d50a1c24874a2ebcfe9ba933 Mon Sep 17 00:00:00 2001 From: Mohammod Al Amin Ashik Date: Mon, 15 Jun 2026 09:15:48 +0800 Subject: [PATCH] ci: use numeric-only pre-release identifier for MSI compatibility The Windows MSI bundler maps the SemVer pre-release identifier to the 4th version field and requires it to be numeric-only and <= 65535, so "0.4.0-pre.185" fails to bundle ("pre" isn't numeric). Use a single numeric identifier instead: "-" (e.g. 0.4.0-185). SemVer ordering is preserved (0.3.0 < 0.4.0-185 < 0.4.0-186 < 0.4.0) and both channels keep building MSI on Windows, matching the installer type existing stable users already have. promote.yml's suffix strip is generalized to "-.*" to recover the stable version from the new format. Signed-off-by: Mohammod Al Amin Ashik --- .github/workflows/promote.yml | 5 +++-- .github/workflows/release.yml | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml index 400eff6a..54cd8a04 100644 --- a/.github/workflows/promote.yml +++ b/.github/workflows/promote.yml @@ -40,8 +40,9 @@ jobs: set -euo pipefail PRE_TAG="${{ inputs.prerelease_tag }}" PRE_TAG="v${PRE_TAG#v}" # normalize leading v - # Strip the -pre.N (and any +build) suffix to get the stable version. - STABLE_VERSION=$(printf '%s' "${PRE_TAG#v}" | sed -E 's/-pre\..*$//; s/\+.*$//') + # Strip the pre-release (-) and any +build suffix to get the + # stable version, e.g. 0.4.0-185 -> 0.4.0. + STABLE_VERSION=$(printf '%s' "${PRE_TAG#v}" | sed -E 's/-.*$//; s/\+.*$//') STABLE_TAG="v${STABLE_VERSION}" # The commit the pre-release was built from (deref annotated tags). diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3808490..4abe2d40 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -129,7 +129,12 @@ jobs: BASE=$(printf '%s' "$CUR" | awk -F. '{printf "%d.%d.%d", $1, $2, $3 + 1}') echo "No open release PR; patch-bumping current ($CUR) -> $BASE" fi - PRE="${BASE}-pre.${{ github.run_number }}" + # The pre-release identifier MUST be numeric-only (a single SemVer + # identifier, no "pre." word): the Windows MSI bundler maps it to the + # 4th version field and rejects non-numeric / >65535 values. So use + # "-", e.g. 0.4.0-185. Ordering still holds: + # 0.3.0 < 0.4.0-185 < 0.4.0-186 < 0.4.0. (run_number stays < 65535.) + PRE="${BASE}-${{ github.run_number }}" echo "version=$PRE" >> "$GITHUB_OUTPUT" echo "Pre-release version: $PRE"