2828 SOVER="${{ github.event.inputs.target_soversion }}"
2929 echo "bumping version to $VER"
3030
31- # 1. CMakeLists.txt: Only update version inside the project() block
31+ # 1. CMakeLists.txt: surgical update inside project()
3232 if [ -f CMakeLists.txt ]; then
3333 echo "updating cmakelists.txt"
3434 sed -i "/project[[:space:]]*([[:space:]]*jsoncpp/,/)/ s/VERSION [0-9.]*/VERSION $VER/" CMakeLists.txt
@@ -37,24 +37,27 @@ jobs:
3737 fi
3838 fi
3939
40- # 2. meson.build: Only update version inside the project() block
40+ # 2. meson.build: surgical update inside project()
4141 if [ -f meson.build ]; then
4242 echo "updating meson.build"
4343 sed -i "/project('jsoncpp'/,/)/ s/version[[:space:]]*:[[:space:]]*['\"][0-9.]*['\"]/version : '$VER'/" meson.build
4444 if [ -n "$SOVER" ]; then
45- # update soversion only within the library() or where defined
45+ # matches soversion : '26'
4646 sed -i "s/soversion[[:space:]]*:[[:space:]]*['\"][0-9]*['\"]/soversion : '$SOVER'/" meson.build
4747 fi
4848 fi
4949
50- # 3. MODULE.bazel: Only update version inside the module() block
50+ # 3. MODULE.bazel: surgical update inside module() only
5151 if [ -f MODULE.bazel ]; then
5252 echo "updating MODULE.bazel"
53- # match range from 'module(' to the first ')'
5453 sed -i "/module(/,/)/ s/version[[:space:]]*=[[:space:]]*['\"][0-9.]*['\"]/version = \"$VER\"/" MODULE.bazel
5554 fi
5655
57- # 4. vcpkg.json: jq is inherently surgical
56+ # 4. vcpkg.json
5857 if [ -f vcpkg.json ]; then
5958 echo "updating vcpkg.json"
60- jq ".version = \"$VER\"" vcpkg.json > vcpkg.json.tmp && mv vcpkg.json.
59+ jq ".version = \"$VER\"" vcpkg.json > vcpkg.json.tmp && mv vcpkg.json.tmp vcpkg.json
60+ fi
61+
62+ # 5. include/json/version.h: split 4-part version safely
63+ if [ -f include/json/version.h ]; then
0 commit comments