CI: fix getting-the-version in release script

This commit is contained in:
Adriaan de Groot 2022-08-23 23:43:25 +02:00
parent 065647154e
commit 0e9cf861f4

View File

@ -86,6 +86,16 @@ KEY_ID="328D742D8807A435"
rm -f CMakeLists.txt.gpg
gpg -s -u $KEY_ID CMakeLists.txt
### Get version number for this release
#
# Do this early, in a clean build-dir, since it doesn't cost much.
# Redirect stderr from CMake script mode, because the message()
# in CMakeLists.txt that prints the version, goes to stderr.
rm -rf "$BUILDDIR"
mkdir "$BUILDDIR" || { echo "Could not create build directory." ; exit 1 ; }
V=$( cd "$BUILDDIR" && cmake -P ../CMakeLists.txt 2>&1 )
test -n "$V" || { echo "Could not obtain version in $BUILDDIR ." ; exit 1 ; }
### Build with default compiler
#
#
@ -124,12 +134,6 @@ else
( cd "$BUILDDIR" && cmake .. ) || { echo "Could not run cmake in $BUILDDIR ." ; exit 1 ; }
fi
### Get version number for this release
#
#
V=$( cd "$BUILDDIR" && cmake -P ../CMakeLists.txt | grep ^CALAMARES_VERSION | sed s/^[A-Z_]*=// )
test -n "$V" || { echo "Could not obtain version in $BUILDDIR ." ; exit 1 ; }
### Create signed tag
#
# This is the signing key ID associated with the GitHub account adriaandegroot,