BUILD: Remove concept of an RELEASE_ID

Having a separate RELEASE_ID just unnecessarily complicates drafting
releases. Plus, now that we are using different build numbers for every
new build anyway, a separate release ID is really not necessary.
This commit is contained in:
Robert Adam 2022-01-01 20:28:35 +01:00
parent 2a31ed0f34
commit 6caa808e67
8 changed files with 9 additions and 92 deletions

View File

@ -26,12 +26,10 @@ else
BUILD_NUMBER=0
fi
RELEASE_ID=$(python "scripts/mumble-version.py")
cd $BUILD_BINARIESDIRECTORY
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=appdir/usr -DCMAKE_UNITY_BUILD=ON \
-DCMAKE_BUILD_TYPE=Release -DRELEASE_ID=$RELEASE_ID -DBUILD_NUMBER=$BUILD_NUMBER \
-DCMAKE_BUILD_TYPE=Release -DBUILD_NUMBER=$BUILD_NUMBER \
-Dtests=ON -Dsymbols=ON -Dgrpc=ON \
-Ddisplay-install-paths=ON $BUILD_SOURCESDIRECTORY

View File

@ -37,12 +37,10 @@ else
BUILD_NUMBER=0
fi
RELEASE_ID=$(python "scripts/mumble-version.py")
cd $BUILD_BINARIESDIRECTORY
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=$MUMBLE_ENVIRONMENT_TOOLCHAIN -DIce_HOME="$MUMBLE_ENVIRONMENT_PATH/installed/x64-osx" \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DRELEASE_ID=$RELEASE_ID -DBUILD_NUMBER=$BUILD_NUMBER \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DBUILD_NUMBER=$BUILD_NUMBER \
-Dtests=ON -Dstatic=ON -Dsymbols=ON -Dgrpc=ON \
-Ddisplay-install-paths=ON $BUILD_SOURCESDIRECTORY

View File

@ -13,10 +13,10 @@
# repository is downloaded.
#
RELEASE_ID=$(python "scripts/mumble-version.py")
VERSION=$(python "scripts/mumble-version.py")
cd $BUILD_BINARIESDIRECTORY
$BUILD_SOURCESDIRECTORY/macx/scripts/osxdist.py --version=$RELEASE_ID --source-dir=$BUILD_SOURCESDIRECTORY --binary-dir=.
$BUILD_SOURCESDIRECTORY/macx/scripts/osxdist.py --version=$VERSION --source-dir=$BUILD_SOURCESDIRECTORY --binary-dir=.
mv *.dmg $BUILD_ARTIFACTSTAGINGDIRECTORY

View File

@ -24,7 +24,7 @@
:: The method we use to store a command's output into a variable:
:: https://stackoverflow.com/a/6362922
for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-version.py" --format version`) do (set "VERSION=%%g")
for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-version.py"`) do (set "VERSION=%%g")
:: For some really stupid reason we can't have this statement and the one where we set the VERSION variable in the same if body as
:: in that case the variable substitution of that variable in the expression below fails (is replaced with empty string)
@ -36,8 +36,6 @@ if defined MUMBLE_BUILD_NUMBER_TOKEN (
set BUILD_NUMBER=0
)
for /f "tokens=* USEBACKQ" %%g in (`python "scripts\mumble-version.py"`) do (set "RELEASE_ID=%%g")
:: Create build directory if it doesn't exist.
if not exist "%MUMBLE_BUILD_DIRECTORY%" mkdir "%MUMBLE_BUILD_DIRECTORY%
@ -50,7 +48,7 @@ set PATH=%PATH%;C:\WixSharp
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE="%MUMBLE_ENVIRONMENT_TOOLCHAIN%" -DVCPKG_TARGET_TRIPLET=%MUMBLE_ENVIRONMENT_TRIPLET% ^
-DIce_HOME="%MUMBLE_ENVIRONMENT_PATH%\installed\%MUMBLE_ENVIRONMENT_TRIPLET%" ^
-DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe ^
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DRELEASE_ID=%RELEASE_ID% -DBUILD_NUMBER=%BUILD_NUMBER% ^
-DCMAKE_BUILD_TYPE=Release -DCMAKE_UNITY_BUILD=ON -DBUILD_NUMBER=%BUILD_NUMBER% ^
-Dpackaging=ON -Dtests=ON -Dstatic=ON -Dsymbols=ON -Dgrpc=ON -Dasio=ON -Dg15=ON ^
-Ddisplay-install-paths=ON %MUMBLE_SOURCE_REPOSITORY%

View File

@ -14,7 +14,6 @@ if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.20.0")
endif()
set(BUILD_NUMBER CACHE STRING "The build number of the current build. Will be used in Mumble's version to make sure newer builds upgrade older installations properly.")
set(RELEASE_ID CACHE STRING "The ID of the current release (used for representation in the UI and the updater)")
if ("${BUILD_NUMBER}" STREQUAL "")
if(packaging)
@ -89,7 +88,6 @@ target_architecture(MUMBLE_TARGET_ARCH)
string(TOLOWER "${MUMBLE_TARGET_ARCH}" MUMBLE_TARGET_ARCH)
message(STATUS "##################################################")
message(STATUS "Mumble release ID: ${RELEASE_ID}")
message(STATUS "Mumble version: ${PROJECT_VERSION}")
message(STATUS "Architecture: ${MUMBLE_TARGET_ARCH}")
if(NOT IS_MULTI_CONFIG)

View File

@ -5,55 +5,7 @@
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.
#
# This script returns the Mumble version string for a Mumble Git
# repository. The script must be run from within a Mumble Git
# repository.
# This is a replacement for `git describe` to make snapshots
# use the future, untagged version number rather than the previous.
#
# The version is of form 1.3.0~2020-07-02~g4f336a2~snapshot.
# It includes the target release version rather than the previous
# release (as git describe does).
#
# Detailed description:
#
# Once upon a time, Mumble used the output of `git describe` as
# its version string.
#
# If a commit was tagged, it was a "release", and got a simple
# string which was the name of the tag.
#
# If a commit wasn't tagged, it got '1.2.6-234-gf552ag1', which
# consists of the number of commits since the latest tag, and
# the commit hash of the latest commit.
#
# However, the output of `git describe` was found to be confusing
# in practice. This is because the base version of the `git describe`
# output is the latest tag, which is to say: the *previous*
# version of Mumble.
#
# So, a user running a snapshot that would become 1.3.0 would be
# running a version like 1.2.6-234-gf552ag1. This is confusing
# simply by looking at the version numbers, but the way versioning
# works inside the Mumble client made it worse: the client's version
# was referred to as "1.3.0" in several places, but the actual version
# number said 1.2.6-234-gf552ag1.
#
# This script is the replacement for `git describe`. It outputs the
# *actual* base version of the Mumble tree, rather than the latest tag.
# This means that snapshots for Mumble 1.3.0 now have the base version
# '1.3.0'.
#
# It also changes the version string: Instead of using dashes
# as a separator in the version string, it now uses tildes. This allows
# Debian's dpkg version comparer to correctly sort snapshot versions
# before release versions. The new string also includes 'snapshot' in the
# version string to denote to users that the given version is a pre-release
# snapshot.
# Furthermore the version number does use the latest commit's date rather
# than therevision number since the last tag.
# A full new-style version string looks like this:
# 1.3.0~2020-07-02~g4f336a2~snapshot.
# This script reads and prints the current Mumble version
from __future__ import (unicode_literals, print_function, division)
@ -100,10 +52,7 @@ def readProjectVersion():
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--format', choices = ['full', 'version', 'suffix'], default='full', help = 'Output format')
parser.add_argument('-n', '--newline', action = "store_true", help = 'Break line after printing version')
parser.add_argument('-r', '--revision', type = int, default = 1, help = 'Revision (only used for type \'beta\' and \'rc\')')
parser.add_argument('-t', '--type', choices = ['snapshot', 'beta', 'rc', 'stable'], default = 'snapshot', help = 'Release type - determines the suffix')
args = parser.parse_args()
if args.newline:
@ -113,27 +62,9 @@ def main():
version = readProjectVersion()
if args.format == 'version':
print(version, end = end)
return
print(version, end = end)
suffix = ''
if args.type == 'rc' or args.type == 'beta':
suffix = '-{0}{1}'.format(args.type, args.revision)
elif args.type == 'snapshot':
# Get the date of the most recent commit
latestCommitDate = cmd(['git', 'log', '-1', '--format=%cd', '--date=short']).strip()
# Get the hash of the most recent commit (shortened)
latestCommitHash = cmd(['git', 'rev-parse', '--short', 'HEAD']).strip()
suffix = '~{0}~g{1}~snapshot'.format(latestCommitDate, latestCommitHash)
if args.format == 'suffix':
print(suffix, end = end)
else:
print(version + suffix, end = end)
if __name__ == '__main__':
main()

View File

@ -128,8 +128,6 @@ target_sources(shared
target_compile_definitions(shared
PUBLIC
"MUMBLE_VERSION=${PROJECT_VERSION}"
# Only define this macro if RELEASE_ID is actually set
$<$<NOT:$<STREQUAL:"${RELEASE_ID}","">>:MUMBLE_RELEASE_ID=${RELEASE_ID}>
)
target_compile_definitions(shared

View File

@ -11,11 +11,7 @@
#define MUMXTEXT(X) #X
#define MUMTEXT(X) MUMXTEXT(X)
#ifndef MUMBLE_RELEASE_ID
# define MUMBLE_RELEASE "Compiled by User"
#else
# define MUMBLE_RELEASE MUMTEXT(MUMBLE_RELEASE_ID)
#endif
#define MUMBLE_RELEASE MUMTEXT(MUMBLE_VERSION)
namespace Version {