Fiddled some more with release script

This commit is contained in:
Linus Probert 2018-05-17 09:49:03 +02:00
parent d4f2514e7e
commit 7f09fbda8d
3 changed files with 14 additions and 10 deletions

View File

@ -7,7 +7,7 @@ project(breakhack C)
set(breakhack_GAME_TITLE "BreakHack") set(breakhack_GAME_TITLE "BreakHack")
set(breakhack_MAJOR_VERSION 0) set(breakhack_MAJOR_VERSION 0)
set(breakhack_MINOR_VERSION 1) set(breakhack_MINOR_VERSION 1)
set(breakhack_PATCH_VERSION 5) set(breakhack_PATCH_VERSION 4)
set(breakhack_RELEASE_TYPE "(early access)") set(breakhack_RELEASE_TYPE "(early access)")
include(FindLua) include(FindLua)
@ -293,9 +293,9 @@ set(CPACK_PACKAGE_VENDOR "OliveShark")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
set(CPACK_PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}/package) set(CPACK_PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}/package)
set(CPACK_PACKAGE_VERSION_MAJOR "0") set(CPACK_PACKAGE_VERSION_MAJOR ${breakhack_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR "1") set(CPACK_PACKAGE_VERSION_MINOR ${breakhack_MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH "1") set(CPACK_PACKAGE_VERSION_PATCH ${breakhack_PATCH_VERSION})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "BreakHack") set(CPACK_PACKAGE_INSTALL_DIRECTORY "BreakHack")
set(CPACK_PACKAGE_FILE_NAME "breakhack-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") set(CPACK_PACKAGE_FILE_NAME "breakhack-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_PACKAGE_CHECKSUM "MD5") set(CPACK_PACKAGE_CHECKSUM "MD5")

View File

View File

@ -1,12 +1,16 @@
#!/bin/sh #!/bin/sh
# Get the current patch version # Get the current patch version
CURRENT_VERSION=$(egrep -o 'breakhack_PATCH_VERSION [0-9]+' CMakeLists.txt | awk '{print $2}') LAST_VERSION=$(egrep -o 'breakhack_PATCH_VERSION [0-9]+' CMakeLists.txt | awk '{print $2}')
git tag early-access-v$CURRENT_VERSION NEXT_VERSION=$((LAST_VERSION + 1))
git push origin early-access-v$CURRENT_VERSION
NEXT_VERSION=$((CURRENT_VERSION + 1)) # Update the version and create release notes
# Update the version
sed -i -e "s/breakhack_PATCH_VERSION [0-9]\+/breakhack_PATCH_VERSION $NEXT_VERSION/" CMakeLists.txt sed -i -e "s/breakhack_PATCH_VERSION [0-9]\+/breakhack_PATCH_VERSION $NEXT_VERSION/" CMakeLists.txt
git log --oneline early-access-v$LAST_VERSION..early-access-v$NEXT_VERSION >> build/releasenotes/early-access-$NEXT_VERSION
git commit -a -m"Patch version raised to $NEXT_VERSION" git commit -a -m"Patch version raised to $NEXT_VERSION"
"push"
# Create the tag
git tag early-access-v$NEXT_VERSION
# Push to repo
git push --follow-tags