aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/release
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-21 22:56:32 +0000
committertv <tv@krebsco.de>2026-11-21 22:56:42 +0000
commit2a9ebe39770754975f3b701a1dbd9127af323ffb (patch)
tree0b8035e621d18b555d2523681e2247deba984127 /scripts/release
parent3507e96d8402ea681343a4b3d63aa87bdceb022f (diff)
release: before 1.0.0, versions read as Cargo reads them
Of 0.Y.Z, a flag day raises Y, a release one node at a time raises Z: the first part that isn't 0 is the major one, so releases before 1.0.0 practise the same kinds of bumps as those after. scripts/release refuses a flag day that doesn't raise it (leading), where before 1.0.0 it took any. The docs' examples release 0.1.0 next: 0.0.2 would read as a flag day after 0.0.1.
Diffstat (limited to 'scripts/release')
-rwxr-xr-xscripts/release14
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/release b/scripts/release
index 62a896a..b88d2a5 100755
--- a/scripts/release
+++ b/scripts/release
@@ -13,7 +13,8 @@
# 3. This build's `continuum --version` and the last release's (built in
# CONTINUUM_RELEASE_TARGET, ~/.cache/continuum/release unless set) say how one upgrades:
# node by node where their wire versions meet, else every node together, which takes
-# a major release from 1.0.0 on; scripts/wire-check runs a swarm of both and checks
+# a major release (before 1.0.0, a raise of the first part that isn't 0, as Cargo reads
+# versions); scripts/wire-check runs a swarm of both and checks
# they do as said.
# 4. CHANGELOG.md's Unreleased notes become VERSION's, under a line saying so; the
# commit `release VERSION` holds it all, tagged vVERSION, its message saying how to
@@ -42,6 +43,11 @@ die() {
say "$*"
exit 1
}
+# The part of version $1 that only a flag day raises, with the rest as 0: the major one, or
+# before 1.0.0 the first that isn't 0, as Cargo reads versions (0.2.0 of 0.2.1).
+leading() {
+ echo "$1" | awk -F. '{ if ($1 > 0) print $1 ".0.0"; else if ($2 > 0) print "0." $2 ".0"; else print "0.0." $3 }'
+}
cd "$(git rev-parse --show-toplevel)"
features=${CONTINUUM_FEATURES:-federation,mycelium}
@@ -136,10 +142,8 @@ if [ -n "$last" ]; then
upgrade="From $last it rolls out node by node: install it on every node, in any order."
else
upgrade="From $last every node upgrades together: $why."
- major_last=$(echo "${last#v}" | cut -d. -f1)
- major_here=$(echo "$version" | cut -d. -f1)
- if [ "$major_last" -ge 1 ] && [ "$major_here" -le "$major_last" ]; then
- die "$why: from 1.0.0 on, that takes a major release, not $version"
+ if [ "$(leading "${last#v}")" = "$(leading "$version")" ]; then
+ die "$why: that takes a major release (before 1.0.0, a new first part that isn't 0), not $version"
fi
fi
say "scripts/wire-check $last"