Skip to content

Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit

build(release): bump-version.sh set X.Y.Z picks any version above the committed one

raymondchinsb5cd23ed289b
diff --git a/docs/RELEASING.md b/docs/RELEASING.md
index e7be5a0..75154c5 100644
--- a/docs/RELEASING.md
+++ b/docs/RELEASING.md
@@ -93,9 +93,12 @@ its version check stops it. `make versioncheck` covers the stamp, the bump and t
of the same sources or runs the checks here.
1. Bump and commit:
```sh
- scripts/bump-version.sh patch # or minor / major
+ scripts/bump-version.sh patch # or minor / major, or set X.Y.Z
git commit -m "chore(release): Bridgeplay X.Y.Z" dylib/version.h
```
+ `set X.Y.Z` takes any version above the committed one, such as `0.7.31` after `0.7.3` for a
+ small follow-up. The numbers compare as integers, so `0.7.31` sorts above `0.7.4`: after it,
+ go on with `0.7.32` (or `patch`) or a minor. Updates still order by the build, which goes up by one.
`scripts/sync-upstream.sh` already bumps the patch after an upstream merge on `main`; on `beta` it
commits no bump, see Betas.
2. Push to `main` of `raymondchins/Bridgeplay` (the script refuses anything else).
diff --git a/dylib/tests/versioncheck.sh b/dylib/tests/versioncheck.sh
index 230ff87..fe6b616 100644
--- a/dylib/tests/versioncheck.sh
+++ b/dylib/tests/versioncheck.sh
@@ -272,6 +272,21 @@ expect_same "a refused bump leaves version.h alone" "$work/version.h.orig" "$bum
expect_refused "named differs from the minor" bump minor --named 0.7.3
expect_refused "named is malformed" bump patch --named 0.7.3-beta.1
expect_refused "named is empty" bump patch --named "" --highest-build 50
+# set picks any version above the committed one; the build still goes up by one.
+expect_ok "set a finer patch" bump set 0.7.31
+bumped 0.7.31 45
+expect_ok "set with the highest build" bump set 0.7.31 --highest-build 50
+bumped 0.7.31 51
+expect_ok "set a named release" bump set 0.7.31 --named 0.7.31
+bumped 0.7.31 45
+expect_refused "set to the committed version" bump set 0.7.2
+expect_refused "set below the committed version" bump set 0.6.9
+expect_same "a refused set leaves version.h alone" "$work/version.h.orig" "$bumpfx/dylib/version.h"
+expect_refused "set without a version" bump set
+for v in 0.7 0.7.31-beta.1 v0.7.31 0.7.3.1; do
+ expect_refused "set '$v'" bump set "$v"
+done
+expect_refused "set named elsewhere" bump set 0.7.31 --named 0.7.3
expect_refused "no part" bump
expect_refused "unknown part" bump beta
diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh
index cea1da9..df21890 100755
--- a/scripts/bump-version.sh
+++ b/scripts/bump-version.sh
@@ -1,10 +1,10 @@
#!/bin/sh
# Bump Bridgeplay's version in dylib/version.h before a release.
#
-# scripts/bump-version.sh patch|minor|major [--upstream "NotProton X.Y.Z"] [--highest-build N] [--named X.Y.Z]
+# scripts/bump-version.sh patch|minor|major|set X.Y.Z [--upstream "NotProton X.Y.Z"] [--highest-build N] [--named X.Y.Z]
#
# Almost always patch (fixes, features, upstream merges); minor and major are rare, see
-# docs/RELEASING.md. BRIDGEPLAY_BUILD goes up by one every time, since Sparkle orders updates by it.
+# docs/RELEASING.md. set picks any X.Y.Z above the committed one (0.7.3 -> 0.7.31). BRIDGEPLAY_BUILD goes up by one every time, since Sparkle orders updates by it.
# --upstream records the NotProton release this build is based on (NOTPROTON_VERSION);
# a clean upstream merge already brings upstream's value, so it is rarely needed.
# --highest-build N (or BRIDGEPLAY_HIGHEST_BUILD) is the highest build ever published, stable or
@@ -28,8 +28,15 @@ usage() {
}
part=${1:-}
+target=""
case "$part" in
patch|minor|major) shift ;;
+ set)
+ [ $# -ge 2 ] || usage
+ is_semver "$2" || { echo "==> set wants X.Y.Z, got '$2'" >&2; exit 1; }
+ target=$2
+ shift 2
+ ;;
*) usage ;;
esac
@@ -74,7 +81,12 @@ if [ -n "$highest" ]; then
is_posint "$highest" || die "--highest-build wants a positive integer, got '$highest'"
fi
-next=$(semver_next "$part" "$version")
+if [ -n "$target" ]; then
+ semver_gt "$target" "$version" || die "set $target is not above the committed $version"
+ next=$target
+else
+ next=$(semver_next "$part" "$version")
+fi
[ -z "$named" ] || [ "$named" = "$next" ] \
|| die "a $part bump of $version gives $next, not $named, the release the beta was named after; pick the matching part"
base_build=$build