diff options
author | Linnea Gräf <nea@nea.moe> | 2024-11-15 00:27:53 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-11-15 18:40:20 +0100 |
commit | f158a9d8b06834e5ab132e658913a7535175d0aa (patch) | |
tree | 079797365d7098f9c42c1946b8ccb323863f556c /docs | |
parent | 2c8152335e600187d18edbd7f53760efda0399b1 (diff) | |
download | Firmament-f158a9d8b06834e5ab132e658913a7535175d0aa.tar.gz Firmament-f158a9d8b06834e5ab132e658913a7535175d0aa.tar.bz2 Firmament-f158a9d8b06834e5ab132e658913a7535175d0aa.zip |
build: Upgrade versioning to handle multiple minecraft versions
Diffstat (limited to 'docs')
-rwxr-xr-x | docs/release_script.sh | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/docs/release_script.sh b/docs/release_script.sh index 4c79e60..43663b4 100755 --- a/docs/release_script.sh +++ b/docs/release_script.sh @@ -84,7 +84,6 @@ parse_commandline "$@" set -euo pipefail REMOTE=origin -BRANCH=master basedir="$(dirname "$(dirname "$(realpath "$0")")")" echo "Found base directory at $basedir" @@ -104,8 +103,10 @@ if [ -n "$(git status --porcelain)" ] && [ "$_arg_no_check" == off ]; then exit 1 fi -if ! [[ "$(git rev-parse --abbrev-ref HEAD)" = "$BRANCH" ]]; then - echo "Not on branch $BRANCH." +current_branch="$(git rev-parse --abbrev-ref HEAD)" + +if ! [[ "$current_branch" = "master" ]] && ! [[ "$current_branch" = mc-* ]]; then + echo "Not on branch master or a mc- branch." exit 1 fi @@ -117,8 +118,15 @@ oldversion="$(git describe --tags --abbrev=0|tr -d '\n')" echo "Choosing old version as $oldversion" +# TODO: auto choose next version based on a command line flag: --minor --hotfix --major as well as minecraft info from libs.versions.toml echo -n "Choosing next version as: " read newversion + +if ! [[ "$newversion" = *+mc* ]] && [ "$_arg_no_check" == off ]; then + echo "Illegal next version $newversion. Please use a.b.c+mcx.y.z" + exit 1 +fi + echo "Confirming new version as $newversion" echo Committing release commit @@ -153,7 +161,7 @@ cat "$releasenotes" echo ---------------------------------------------- echo Pushing to github -git push "$REMOTE" "$BRANCH" "$newversion" +git push "$REMOTE" "HEAD" "$newversion" if command -v gh; then echo Creating github release |