diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-08-20 17:20:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-20 17:20:11 +0200 |
commit | c99dcbaca99c0bf3cf90efb6670d946898e23ae6 (patch) | |
tree | 7b00dfc421be40af049b09f3f1e41f35a4f7ff34 | |
parent | 1c1c97cbd1d7913ac12bf550ec02c97f843a0fd3 (diff) | |
download | minetest-c99dcbaca99c0bf3cf90efb6670d946898e23ae6.tar.gz minetest-c99dcbaca99c0bf3cf90efb6670d946898e23ae6.tar.bz2 minetest-c99dcbaca99c0bf3cf90efb6670d946898e23ae6.zip |
New version scheme (#6292)
* Version changes: current dev version is now 0.5.0
* This change permit to have multi branches with various versions
* Dev version is 0.5.0-dev and next release will be 0.5.0
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | doc/client_lua_api.md | 2 | ||||
-rw-r--r-- | doc/lua_api.txt | 2 | ||||
-rw-r--r-- | doc/menu_lua_api.txt | 2 | ||||
-rwxr-xr-x | util/bump_version.sh | 146 |
6 files changed, 93 insertions, 73 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index df5c00e08..b405d5e2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,8 @@ set(CMAKE_CXX_STANDARD 11) # Also remember to set PROTOCOL_VERSION in network/networkprotocol.h when releasing set(VERSION_MAJOR 0) -set(VERSION_MINOR 4) -set(VERSION_PATCH 16) +set(VERSION_MINOR 5) +set(VERSION_PATCH 0) set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string") # Change to false for releases @@ -415,3 +415,13 @@ This is how we build Windows releases. popd echo Failed. exit /b 1 + +Version scheme +-------------- + +Minetest doesn't follow semver. Instead, we do something roughly similar to 0.major.minor. + +Since 0.5.0-dev and 0.4.17-dev, the dev notation refers to the next release, +ie: 0.5.0-dev is the development version leading to 0.5.0. + +Prior to that, we used oldversion-dev. diff --git a/doc/client_lua_api.md b/doc/client_lua_api.md index 1f7c6b0cc..5be007c75 100644 --- a/doc/client_lua_api.md +++ b/doc/client_lua_api.md @@ -1,4 +1,4 @@ -Minetest Lua Client Modding API Reference 0.4.16 +Minetest Lua Client Modding API Reference 0.5.0 ================================================ * More information at <http://www.minetest.net/> * Developer Wiki: <http://dev.minetest.net/> diff --git a/doc/lua_api.txt b/doc/lua_api.txt index dcc2de180..3c87c2e2f 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1,4 +1,4 @@ -Minetest Lua Modding API Reference 0.4.16 +Minetest Lua Modding API Reference 0.5.0 ========================================= * More information at <http://www.minetest.net/> * Developer Wiki: <http://dev.minetest.net/> diff --git a/doc/menu_lua_api.txt b/doc/menu_lua_api.txt index 449b18b1c..1d158f304 100644 --- a/doc/menu_lua_api.txt +++ b/doc/menu_lua_api.txt @@ -1,4 +1,4 @@ -Minetest Lua Mainmenu API Reference 0.4.16 +Minetest Lua Mainmenu API Reference 0.5.0 ======================================== Introduction diff --git a/util/bump_version.sh b/util/bump_version.sh index d756d6ba1..35cad78a7 100755 --- a/util/bump_version.sh +++ b/util/bump_version.sh @@ -1,6 +1,4 @@ -#!/bin/bash - -die() { echo "$@" 1>&2 ; exit 1; } +#!/bin/bash -e prompt_for_number() { local prompt_text=$1 @@ -16,7 +14,50 @@ prompt_for_number() { done } +# On a release the following actions are performed +# * DEVELOPMENT_BUILD is set to false +# * android versionCode is bumped +# * Commit the changes +# * Tag with current version +perform_release() { + sed -i -re "s/^set\(DEVELOPMENT_BUILD TRUE\)$/set(DEVELOPMENT_BUILD FALSE)/" CMakeLists.txt + + sed -i -re "s/versionCode [0-9]+$/versionCode $NEW_ANDROID_VERSION_CODE/" build/android/build.gradle + + git add -f CMakeLists.txt build/android/build.gradle + + git commit -m "Bump version to $RELEASE_VERSION" + + echo "Tagging $RELEASE_VERSION" + + git tag -a "$RELEASE_VERSION" -m "$RELEASE_VERSION" +} + +# After release +# * Set DEVELOPMENT_BUILD to true +# * Bump version in CMakeLists and docs +# * Commit the changes +back_to_devel() { + echo 'Creating "return back to development" commit' + + sed -i -re 's/^set\(DEVELOPMENT_BUILD FALSE\)$/set(DEVELOPMENT_BUILD TRUE)/' CMakeLists.txt + + sed -i -re "s/^set\(VERSION_MAJOR [0-9]+\)$/set(VERSION_MAJOR $NEXT_VERSION_MAJOR)/" CMakeLists.txt + + sed -i -re "s/^set\(VERSION_MINOR [0-9]+\)$/set(VERSION_MINOR $NEXT_VERSION_MINOR)/" CMakeLists.txt + + sed -i -re "s/^set\(VERSION_PATCH [0-9]+\)$/set(VERSION_PATCH $NEXT_VERSION_PATCH)/" CMakeLists.txt + sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEXT_VERSION/g" doc/lua_api.txt + + sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEXT_VERSION/g" doc/menu_lua_api.txt + + sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEXT_VERSION/g" doc/client_lua_api.md + + git add -f CMakeLists.txt doc/lua_api.txt doc/menu_lua_api.txt doc/client_lua_api.md + + git commit -m "Continue with $NEXT_VERSION-dev" +} ################################## # Switch to top minetest directory ################################## @@ -29,95 +70,64 @@ cd ${0%/*}/.. ####################### # Make sure all the files we need exist -grep -q -E '^set\(VERSION_MAJOR [0-9]+\)$' CMakeLists.txt || die "error: Could not find CMakeLists.txt" -grep -q -E '^set\(VERSION_MINOR [0-9]+\)$' CMakeLists.txt || die "error: Could not find CMakeLists.txt" -grep -q -E '^set\(VERSION_PATCH [0-9]+\)$' CMakeLists.txt || die "error: Could not find CMakeLists.txt" -grep -q -E 'versionCode [0-9]+$' build/android/build.gradle || die "error: Could not find Android version code" +grep -q -E '^set\(VERSION_MAJOR [0-9]+\)$' CMakeLists.txt +grep -q -E '^set\(VERSION_MINOR [0-9]+\)$' CMakeLists.txt +grep -q -E '^set\(VERSION_PATCH [0-9]+\)$' CMakeLists.txt +grep -q -E 'versionCode [0-9]+$' build/android/build.gradle VERSION_MAJOR=$(grep -E '^set\(VERSION_MAJOR [0-9]+\)$' CMakeLists.txt | tr -dC 0-9) VERSION_MINOR=$(grep -E '^set\(VERSION_MINOR [0-9]+\)$' CMakeLists.txt | tr -dC 0-9) VERSION_PATCH=$(grep -E '^set\(VERSION_PATCH [0-9]+\)$' CMakeLists.txt | tr -dC 0-9) ANDROID_VERSION_CODE=$(grep -E 'versionCode [0-9]+$' build/android/build.gradle | tr -dC 0-9) -echo "Current Minetest version: $VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH" -echo "Current Android version code: $ANDROID_VERSION_CODE" - - -######################## -# Prompt for new version -######################## - -NEW_VERSION_MAJOR=$VERSION_MAJOR -NEW_VERSION_MINOR=$VERSION_MINOR -NEW_VERSION_PATCH=$(expr $VERSION_PATCH + 1) - -NEW_VERSION_MAJOR=$(prompt_for_number "Set major" $NEW_VERSION_MAJOR) +RELEASE_VERSION="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH" -if [ "$NEW_VERSION_MAJOR" != "$VERSION_MAJOR" ]; then - NEW_VERSION_MINOR=0 - NEW_VERSION_PATCH=0 -fi - -NEW_VERSION_MINOR=$(prompt_for_number "Set minor" $NEW_VERSION_MINOR) - -if [ "$NEW_VERSION_MINOR" != "$VERSION_MINOR" ]; then - NEW_VERSION_PATCH=0 -fi - -NEW_VERSION_PATCH=$(prompt_for_number "Set patch" $NEW_VERSION_PATCH) +echo "Current Minetest version: $RELEASE_VERSION" +echo "Current Android version code: $ANDROID_VERSION_CODE" NEW_ANDROID_VERSION_CODE=$(expr $ANDROID_VERSION_CODE + 1) NEW_ANDROID_VERSION_CODE=$(prompt_for_number "Set android version code" $NEW_ANDROID_VERSION_CODE) -NEW_VERSION="$NEW_VERSION_MAJOR.$NEW_VERSION_MINOR.$NEW_VERSION_PATCH" - - echo -echo "New version: $NEW_VERSION" echo "New android version code: $NEW_ANDROID_VERSION_CODE" +######################## +# Perform release +######################## -####################################### -# Replace version everywhere and commit -####################################### - -sed -i -re "s/^set\(VERSION_MAJOR [0-9]+\)$/set(VERSION_MAJOR $NEW_VERSION_MAJOR)/" CMakeLists.txt || die "Failed to update VERSION_MAJOR" - -sed -i -re "s/^set\(VERSION_MINOR [0-9]+\)$/set(VERSION_MINOR $NEW_VERSION_MINOR)/" CMakeLists.txt || die "Failed to update VERSION_MINOR" - -sed -i -re "s/^set\(VERSION_PATCH [0-9]+\)$/set(VERSION_PATCH $NEW_VERSION_PATCH)/" CMakeLists.txt || die "Failed to update VERSION_PATCH" - -sed -i -re "s/^set\(DEVELOPMENT_BUILD TRUE\)$/set(DEVELOPMENT_BUILD FALSE)/" CMakeLists.txt || die "Failed to unset DEVELOPMENT_BUILD" - -sed -i -re "s/versionCode [0-9]+$/versionCode $NEW_ANDROID_VERSION_CODE/" build/android/build.gradle || die "Failed to update Android version code" - -sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" doc/lua_api.txt || die "Failed to update doc/lua_api.txt" - -sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" doc/menu_lua_api.txt || die "Failed to update doc/menu_lua_api.txt" +perform_release -sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" doc/client_lua_api.md || die "Failed to update doc/client_lua_api.md" +######################## +# Prompt for next version +######################## -git add -f CMakeLists.txt build/android/build.gradle doc/lua_api.txt doc/menu_lua_api.txt doc/client_lua_api.md || die "git add failed" +NEXT_VERSION_MAJOR=$VERSION_MAJOR +NEXT_VERSION_MINOR=$VERSION_MINOR +NEXT_VERSION_PATCH=$(expr $VERSION_PATCH + 1) -git commit -m "Bump version to $NEW_VERSION" || die "git commit failed" +NEXT_VERSION_MAJOR=$(prompt_for_number "Set next major" $NEXT_VERSION_MAJOR) -############ -# Create tag -############ +if [ "$NEXT_VERSION_MAJOR" != "$VERSION_MAJOR" ]; then + NEXT_VERSION_MINOR=0 + NEXT_VERSION_PATCH=0 +fi -echo "Tagging $NEW_VERSION" +NEXT_VERSION_MINOR=$(prompt_for_number "Set next minor" $NEXT_VERSION_MINOR) -git tag -a "$NEW_VERSION" -m "$NEW_VERSION" || die 'Adding tag failed' +if [ "$NEXT_VERSION_MINOR" != "$VERSION_MINOR" ]; then + NEXT_VERSION_PATCH=0 +fi -###################### -# Create revert commit -###################### +NEXT_VERSION_PATCH=$(prompt_for_number "Set next patch" $NEXT_VERSION_PATCH) -echo 'Creating "revert to development" commit' +NEXT_VERSION="$NEXT_VERSION_MAJOR.$NEXT_VERSION_MINOR.$NEXT_VERSION_PATCH" -sed -i -re 's/^set\(DEVELOPMENT_BUILD FALSE\)$/set(DEVELOPMENT_BUILD TRUE)/' CMakeLists.txt || die 'Failed to set DEVELOPMENT_BUILD' +echo +echo "New version: $NEXT_VERSION" -git add -f CMakeLists.txt || die 'git add failed' +######################## +# Return back to devel +######################## -git commit -m "Continue with $NEW_VERSION-dev" || die 'git commit failed' +back_to_devel |