Skip to content

Commit 8611ffc

Browse files
committed
fix: prerelease version increment should not bump base version
The create-tag workflow was always applying the bump type to the base version, even when already on a prerelease channel. This caused 0.11.0-next.1 + minor + next to produce 0.12.0-next.1 instead of 0.11.0-next.2. Fixed bump_version logic to handle three flows: - Same prerelease channel: keep base, increment counter - Promoting prerelease to stable: use base as-is - Stable to new prerelease or stable bump: apply bump type Also reverts manifests from 0.12.0-next.1 back to 0.11.0-next.1.
1 parent d245387 commit 8611ffc

7 files changed

Lines changed: 31 additions & 12 deletions

File tree

.github/workflows/create-tag.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,32 @@ jobs:
112112
local base="${current%%-*}"
113113
IFS='.' read -r major minor patch <<< "$base"
114114
115-
case "$bump_type" in
116-
major) major=$((major + 1)); minor=0; patch=0 ;;
117-
minor) minor=$((minor + 1)); patch=0 ;;
118-
patch) patch=$((patch + 1)) ;;
119-
esac
115+
# Check if current version already has the requested pre-release label
116+
local current_pre=""
117+
if [[ "$current" =~ -([a-z]+)\.[0-9]+$ ]]; then
118+
current_pre="${BASH_REMATCH[1]}"
119+
fi
120120
121-
local new_base="${major}.${minor}.${patch}"
121+
local new_base
122+
if [[ "$PRERELEASE" != "none" && "$current_pre" == "$PRERELEASE" ]]; then
123+
# Same pre-release channel: keep base, increment counter
124+
# e.g. 0.12.0-next.1 → 0.12.0-next.2
125+
new_base="$base"
126+
elif [[ "$PRERELEASE" == "none" && -n "$current_pre" ]]; then
127+
# Promoting pre-release to stable: use base as-is
128+
# e.g. 0.12.0-next.3 → 0.12.0
129+
new_base="$base"
130+
else
131+
# Stable → stable bump, or stable → new pre-release
132+
# e.g. 0.11.0 + minor → 0.12.0
133+
# e.g. 0.11.0 + minor + next → 0.12.0-next.1
134+
case "$bump_type" in
135+
major) major=$((major + 1)); minor=0; patch=0 ;;
136+
minor) minor=$((minor + 1)); patch=0 ;;
137+
patch) patch=$((patch + 1)) ;;
138+
esac
139+
new_base="${major}.${minor}.${patch}"
140+
fi
122141
123142
if [[ "$PRERELEASE" != "none" ]]; then
124143
local existing

console/packages/console-rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "iii-console"
3-
version = "0.12.0-next.1"
3+
version = "0.11.0-next.1"
44
edition = "2021"
55
description = "Developer console for the iii engine"
66
license = "Apache-2.0"

engine/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "iii"
3-
version = "0.12.0-next.1"
3+
version = "0.11.0-next.1"
44
edition = "2024"
55
license = "Elastic-2.0"
66

sdk/packages/node/iii-browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iii-browser-sdk",
3-
"version": "0.12.0-next.1",
3+
"version": "0.11.0-next.1",
44
"private": false,
55
"publishConfig": {
66
"access": "public"

sdk/packages/node/iii/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iii-sdk",
3-
"version": "0.12.0-next.1",
3+
"version": "0.11.0-next.1",
44
"private": false,
55
"publishConfig": {
66
"access": "public"

sdk/packages/python/iii/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "iii-sdk"
7-
version = "0.12.0.dev1"
7+
version = "0.11.0.dev1"
88
description = "III SDK for Python"
99
authors = [{ name = "III" }]
1010
license = { text = "Apache-2.0" }

sdk/packages/rust/iii/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "iii-sdk"
3-
version = "0.12.0-next.1"
3+
version = "0.11.0-next.1"
44
edition = "2024"
55
rust-version = "1.85"
66
license = "Apache-2.0"

0 commit comments

Comments
 (0)