Update versioning scheme
This commit is contained in:
parent
7f04d34179
commit
ae248d6d32
6 changed files with 61 additions and 26 deletions
|
|
@ -300,15 +300,12 @@ before_script:
|
||||||
image: fedora:40
|
image: fedora:40
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- dnf install rpmdevtools dnf-plugins-core libcurl-devel qt5-qtbase-devel -y
|
- dnf install rpmdevtools dnf-plugins-core libcurl-devel qt5-qtbase-devel git -y
|
||||||
- rpmdev-setuptree
|
- rpmdev-setuptree
|
||||||
- ./scripts/build-package-files.sh fedora/OpenRGB.spec
|
- ./scripts/build-package-files.sh fedora/OpenRGB.spec
|
||||||
- ls /root/
|
|
||||||
- cp fedora/OpenRGB.spec /root/rpmbuild/SPECS
|
- cp fedora/OpenRGB.spec /root/rpmbuild/SPECS
|
||||||
- cp ../OpenRGB /root/rpmbuild/SOURCES/ -r
|
- cp -rp . /root/rpmbuild/SOURCES/OpenRGB
|
||||||
- cd /root/rpmbuild/SOURCES
|
- cd /root/rpmbuild
|
||||||
- tar -cf OpenRGB.tar.gz OpenRGB/
|
|
||||||
- cd ..
|
|
||||||
- dnf builddep SPECS/OpenRGB.spec -y
|
- dnf builddep SPECS/OpenRGB.spec -y
|
||||||
- rpmbuild -ba SPECS/OpenRGB.spec
|
- rpmbuild -ba SPECS/OpenRGB.spec
|
||||||
- cd RPMS/x86_64/
|
- cd RPMS/x86_64/
|
||||||
|
|
|
||||||
42
OpenRGB.pro
42
OpenRGB.pro
|
|
@ -26,11 +26,44 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
#-----------------------------------------------------------------------------------------------#
|
#-----------------------------------------------------------------------------------------------#
|
||||||
MAJOR = 0
|
MAJOR = 0
|
||||||
MINOR = 9
|
MINOR = 9
|
||||||
REVISION = 1
|
SUFFIX = git
|
||||||
VERSION = $$MAJOR"."$$MINOR$$REVISION
|
|
||||||
|
SHORTHASH = $$system("git rev-parse --short=7 HEAD")
|
||||||
|
LASTTAG = "release_"$$MAJOR"."$$MINOR
|
||||||
|
COMMAND = "git rev-list --count "$$LASTTAG"..HEAD"
|
||||||
|
COMMITS = $$system($$COMMAND)
|
||||||
|
|
||||||
|
VERSION_NUM = $$MAJOR"."$$MINOR"."$$COMMITS
|
||||||
|
VERSION_STR = $$MAJOR"."$$MINOR
|
||||||
|
|
||||||
|
VERSION_DEB = $$VERSION_NUM
|
||||||
|
VERSION_WIX = $$VERSION_NUM".0"
|
||||||
|
VERSION_AUR = $$VERSION_NUM
|
||||||
|
VERSION_RPM = $$VERSION_NUM
|
||||||
|
|
||||||
|
equals(SUFFIX, "git") {
|
||||||
|
VERSION_STR = $$VERSION_STR"+ ("$$SUFFIX$$COMMITS")"
|
||||||
|
VERSION_DEB = $$VERSION_DEB"~git"$$SHORTHASH
|
||||||
|
VERSION_AUR = $$VERSION_AUR"-g"$$SHORTHASH
|
||||||
|
VERSION_RPM = $$VERSION_RPM"^git"$$SHORTHASH
|
||||||
|
} else {
|
||||||
|
!isEmpty(SUFFIX) {
|
||||||
|
VERSION_STR = $$VERSION_STR"+ ("$$SUFFIX")"
|
||||||
|
VERSION_DEB = $$VERSION_DEB"~"$$SUFFIX
|
||||||
|
VERSION_AUR = $$VERSION_AUR"-"$$SUFFIX
|
||||||
|
VERSION_RPM = $$VERSION_RPM"^"$$SUFFIX
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TARGET = OpenRGB
|
TARGET = OpenRGB
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
|
|
||||||
|
message("VERSION_NUM: "$$VERSION_NUM)
|
||||||
|
message("VERSION_STR: "$$VERSION_STR)
|
||||||
|
message("VERSION_DEB: "$$VERSION_DEB)
|
||||||
|
message("VERSION_WIX: "$$VERSION_WIX)
|
||||||
|
message("VERSION_AUR: "$$VERSION_AUR)
|
||||||
|
message("VERSION_RPM: "$$VERSION_RPM)
|
||||||
#-----------------------------------------------------------------------------------------------#
|
#-----------------------------------------------------------------------------------------------#
|
||||||
# Automatically generated build information #
|
# Automatically generated build information #
|
||||||
#-----------------------------------------------------------------------------------------------#
|
#-----------------------------------------------------------------------------------------------#
|
||||||
|
|
@ -40,10 +73,11 @@ freebsd:BUILDDATE = $$system(date -j -R -r "${SOURCE_DATE_EPOCH:-$(date +%
|
||||||
macx:BUILDDATE = $$system(date -j -R -r "${SOURCE_DATE_EPOCH:-$(date +%s)}")
|
macx:BUILDDATE = $$system(date -j -R -r "${SOURCE_DATE_EPOCH:-$(date +%s)}")
|
||||||
GIT_COMMIT_ID = $$system(git log -n 1 --pretty=format:"%H")
|
GIT_COMMIT_ID = $$system(git log -n 1 --pretty=format:"%H")
|
||||||
GIT_COMMIT_DATE = $$system(git log -n 1 --pretty=format:"%ci")
|
GIT_COMMIT_DATE = $$system(git log -n 1 --pretty=format:"%ci")
|
||||||
GIT_BRANCH = $$system(git branch --show-current)
|
GIT_BRANCH = $$system(scripts/git-get-branch.sh)
|
||||||
|
|
||||||
|
message("GIT_BRANCH: "$$GIT_BRANCH)
|
||||||
DEFINES += \
|
DEFINES += \
|
||||||
VERSION_STRING=\\"\"\"$$VERSION\\"\"\" \
|
VERSION_STRING=\\"\"\"$$VERSION_STR\\"\"\" \
|
||||||
BUILDDATE_STRING=\\"\"\"$$BUILDDATE\\"\"\" \
|
BUILDDATE_STRING=\\"\"\"$$BUILDDATE\\"\"\" \
|
||||||
GIT_COMMIT_ID=\\"\"\"$$GIT_COMMIT_ID\\"\"\" \
|
GIT_COMMIT_ID=\\"\"\"$$GIT_COMMIT_ID\\"\"\" \
|
||||||
GIT_COMMIT_DATE=\\"\"\"$$GIT_COMMIT_DATE\\"\"\" \
|
GIT_COMMIT_DATE=\\"\"\"$$GIT_COMMIT_DATE\\"\"\" \
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ Summary: Open source RGB lighting control that doesn't depend on manufact
|
||||||
|
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
URL: https://gitlab.com/CalcProgrammer1/%{_name}
|
URL: https://gitlab.com/CalcProgrammer1/%{_name}
|
||||||
Source0: OpenRGB.tar.gz
|
|
||||||
|
|
||||||
BuildRequires: gcc-c++ libusbx-devel libstdc++-devel qt5-qtbase-devel qt5-linguist desktop-file-utils hidapi-devel mbedtls-devel systemd-rpm-macros
|
BuildRequires: gcc-c++ libusbx-devel libstdc++-devel qt5-qtbase-devel qt5-linguist desktop-file-utils hidapi-devel mbedtls-devel systemd-rpm-macros
|
||||||
Requires: hicolor-icon-theme
|
Requires: hicolor-icon-theme
|
||||||
|
|
@ -18,7 +17,7 @@ Open source RGB lighting control that doesn't depend on manufacturer software. S
|
||||||
ASUS, ASRock, Corsair, G.Skill, Gigabyte, HyperX, MSI, Razer, ThermalTake, and more supported
|
ASUS, ASRock, Corsair, G.Skill, Gigabyte, HyperX, MSI, Razer, ThermalTake, and more supported
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
cp %{_sourcedir}/%{_name}/* %{_builddir} -r
|
cp -r %{_sourcedir}/%{_name}/. %{_builddir}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
cd %{_builddir}
|
cd %{_builddir}
|
||||||
|
|
|
||||||
|
|
@ -7,19 +7,14 @@ LICENSEFILE="scripts/License.rtf"
|
||||||
BANNERIMAGE="scripts/banner.bmp"
|
BANNERIMAGE="scripts/banner.bmp"
|
||||||
DIALOGBACKGROUND="scripts/dialog_background.bmp"
|
DIALOGBACKGROUND="scripts/dialog_background.bmp"
|
||||||
ZIP="/jobs/artifacts/master/download?job=Windows+64"
|
ZIP="/jobs/artifacts/master/download?job=Windows+64"
|
||||||
|
PROJECT_FILE="OpenRGB.pro"
|
||||||
|
|
||||||
PRODUCTID=$(uuidgen -n @url -N ${WEBSITE} --sha1 | awk '{ print toupper($0) }')
|
PRODUCTID=$(uuidgen -n @url -N ${WEBSITE} --sha1 | awk '{ print toupper($0) }')
|
||||||
PRODUCTNAME="OpenRGB"
|
PRODUCTNAME="OpenRGB"
|
||||||
VENDOR=$PRODUCTNAME
|
VENDOR=$PRODUCTNAME
|
||||||
PRODUCTCOMMENT="Open source RGB lighting control that doesn't depend on manufacturer software."
|
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:])
|
VERSION=$(qmake ${PROJECT_FILE} 2>&1 | grep VERSION_WIX | cut -d ':' -f 3 | tr -d ' ')
|
||||||
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}"
|
|
||||||
|
|
||||||
XMLOUTFILE=${PRODUCTNAME,,}".wxs"
|
XMLOUTFILE=${PRODUCTNAME,,}".wxs"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,13 +19,20 @@ if [ -e ${1} ]; then
|
||||||
echo "Warning: File ${1} exists and will be overwritten"
|
echo "Warning: File ${1} exists and will be overwritten"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
MAJOR=$(grep MAJOR\ ${PROJECT_FILE} | cut -d= -f 2 | tr -d [:space:])
|
VERSION_VAR="VERSION_NUM"
|
||||||
MINOR=$(grep MINOR\ ${PROJECT_FILE} | cut -d= -f 2 | tr -d [:space:])
|
QMAKE_EXE="qmake"
|
||||||
REVISION=$(grep REVISION\ ${PROJECT_FILE} | cut -d= -f 2 | tr -d [:space:])
|
|
||||||
|
|
||||||
#Convert Revision to a nummber in case it is blank in the project file
|
if [[ ${1} == *"debian"* ]]; then
|
||||||
REVISION=$(( ${REVISION} + 0 ))
|
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}
|
sed -e "s/${VERSION_PATTERN}/${PACKAGE_VERSION}/g" ${INFILE_PATH} > ${1}
|
||||||
|
|
|
||||||
3
scripts/git-get-branch.sh
Executable file
3
scripts/git-get-branch.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
git show-ref | grep $(git log --pretty=%h -1) | sed 's|.*/\(.*\)|\1|' | sort -u | grep -v HEAD
|
||||||
Loading…
Add table
Add a link
Reference in a new issue