Skip to content

Commit 53afa2d

Browse files
authored
ci: numeric-only pre-release identifier for Windows MSI (#161)
Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
1 parent 542ccc5 commit 53afa2d

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/promote.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ jobs:
4040
set -euo pipefail
4141
PRE_TAG="${{ inputs.prerelease_tag }}"
4242
PRE_TAG="v${PRE_TAG#v}" # normalize leading v
43-
# Strip the -pre.N (and any +build) suffix to get the stable version.
44-
STABLE_VERSION=$(printf '%s' "${PRE_TAG#v}" | sed -E 's/-pre\..*$//; s/\+.*$//')
43+
# Strip the pre-release (-<n>) and any +build suffix to get the
44+
# stable version, e.g. 0.4.0-185 -> 0.4.0.
45+
STABLE_VERSION=$(printf '%s' "${PRE_TAG#v}" | sed -E 's/-.*$//; s/\+.*$//')
4546
STABLE_TAG="v${STABLE_VERSION}"
4647
4748
# The commit the pre-release was built from (deref annotated tags).

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,12 @@ jobs:
129129
BASE=$(printf '%s' "$CUR" | awk -F. '{printf "%d.%d.%d", $1, $2, $3 + 1}')
130130
echo "No open release PR; patch-bumping current ($CUR) -> $BASE"
131131
fi
132-
PRE="${BASE}-pre.${{ github.run_number }}"
132+
# The pre-release identifier MUST be numeric-only (a single SemVer
133+
# identifier, no "pre." word): the Windows MSI bundler maps it to the
134+
# 4th version field and rejects non-numeric / >65535 values. So use
135+
# "<base>-<run_number>", e.g. 0.4.0-185. Ordering still holds:
136+
# 0.3.0 < 0.4.0-185 < 0.4.0-186 < 0.4.0. (run_number stays < 65535.)
137+
PRE="${BASE}-${{ github.run_number }}"
133138
echo "version=$PRE" >> "$GITHUB_OUTPUT"
134139
echo "Pre-release version: $PRE"
135140

0 commit comments

Comments
 (0)