Update versioning scheme

This commit is contained in:
Adam Honse 2025-01-16 17:51:20 +00:00
parent 7f04d34179
commit ae248d6d32
6 changed files with 61 additions and 26 deletions

View file

@ -7,19 +7,14 @@ LICENSEFILE="scripts/License.rtf"
BANNERIMAGE="scripts/banner.bmp"
DIALOGBACKGROUND="scripts/dialog_background.bmp"
ZIP="/jobs/artifacts/master/download?job=Windows+64"
PROJECT_FILE="OpenRGB.pro"
PRODUCTID=$(uuidgen -n @url -N ${WEBSITE} --sha1 | awk '{ print toupper($0) }')
PRODUCTNAME="OpenRGB"
VENDOR=$PRODUCTNAME
PRODUCTCOMMENT="Open source RGB lighting control that doesn't depend on manufacturer software."
MAJOR=$(grep "MAJOR\ *=" OpenRGB.pro | cut -d= -f 2 | tr -d [:space:])
MINOR=$(grep "MINOR\ *=" OpenRGB.pro | cut -d= -f 2 | tr -d [:space:])
REVISION=$(grep "REVISION\ *=" OpenRGB.pro | cut -d= -f 2 | tr -d [:space:])
#The commit count since last tag. The commit ID can be added with group \3 however Wix only accepts integers
RELEASE=$(git describe --tags --abbrev=8 | sed -E "s/(.*)-([0-9]*)-g(\w*)/\2/g")
VERSION="${MAJOR}.${MINOR}.${REVISION}.${RELEASE}"
VERSION=$(qmake ${PROJECT_FILE} 2>&1 | grep VERSION_WIX | cut -d ':' -f 3 | tr -d ' ')
XMLOUTFILE=${PRODUCTNAME,,}".wxs"
@ -99,4 +94,4 @@ echo -e "\t...Done!\n\n"
#Once the XML file manifest is created create the package
candle -arch x64 ${PRODUCTNAME,,}.wxs
light -sval -ext WixUIExtension ${PRODUCTNAME,,}.wixobj -out ${PRODUCTNAME}_Windows_64.msi
light -sval -ext WixUIExtension ${PRODUCTNAME,,}.wixobj -out ${PRODUCTNAME}_Windows_64.msi

View file

@ -19,13 +19,20 @@ if [ -e ${1} ]; then
echo "Warning: File ${1} exists and will be overwritten"
fi
MAJOR=$(grep MAJOR\ ${PROJECT_FILE} | cut -d= -f 2 | tr -d [:space:])
MINOR=$(grep MINOR\ ${PROJECT_FILE} | cut -d= -f 2 | tr -d [:space:])
REVISION=$(grep REVISION\ ${PROJECT_FILE} | cut -d= -f 2 | tr -d [:space:])
VERSION_VAR="VERSION_NUM"
QMAKE_EXE="qmake"
#Convert Revision to a nummber in case it is blank in the project file
REVISION=$(( ${REVISION} + 0 ))
if [[ ${1} == *"debian"* ]]; then
VERSION_VAR="VERSION_DEB"
QMAKE_EXE="qmake"
fi
PACKAGE_VERSION="${MAJOR}.${MINOR}.${REVISION}"
if [[ ${1} == *"fedora"* ]]; then
VERSION_VAR="VERSION_RPM"
QMAKE_EXE="qmake-qt5"
fi
PACKAGE_VERSION=$(${QMAKE_EXE} ${PROJECT_FILE} 2>&1 | grep ${VERSION_VAR} | cut -d ':' -f 3 | tr -d ' ')
echo $PACKAGE_VERSION
sed -e "s/${VERSION_PATTERN}/${PACKAGE_VERSION}/g" ${INFILE_PATH} > ${1}

3
scripts/git-get-branch.sh Executable file
View file

@ -0,0 +1,3 @@
#! /bin/bash
git show-ref | grep $(git log --pretty=%h -1) | sed 's|.*/\(.*\)|\1|' | sort -u | grep -v HEAD