From 7a42df05f3c1a68e7c78e677b9306c181422db28 Mon Sep 17 00:00:00 2001 From: dsm <41967334+dsm@users.noreply.github.com> Date: Mon, 26 Aug 2024 18:33:04 +0300 Subject: [PATCH] hide git hash for stable releases. --- .github/workflows/deploy.yml | 4 ++-- qucs/misc.cpp | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 46833d14..4772a043 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -33,11 +33,11 @@ jobs: id: read_version run: | if [ "${{github.ref_type}}" == "tag" ]; then - VERSION=$(cat VERSION) + VERSION=${{ github.ref_name }} echo "VERSION=$VERSION" >> $GITHUB_ENV echo "version=$VERSION" >> $GITHUB_OUTPUT else - VERSION=${{env.CI_VERSION}} + VERSION=${{ env.CI_VERSION }} echo "VERSION=$VERSION" >> $GITHUB_ENV echo "version=$VERSION" >> $GITHUB_OUTPUT fi diff --git a/qucs/misc.cpp b/qucs/misc.cpp index 7f2e68fd..d04455e0 100644 --- a/qucs/misc.cpp +++ b/qucs/misc.cpp @@ -41,14 +41,16 @@ QString misc::getWindowTitle() { - QString title = QUCS_NAME " " PACKAGE_VERSION; + QString title = QString("%1 %2").arg(QUCS_NAME,PACKAGE_VERSION); if (title.endsWith(".0")) { title.chop(2); } -#if defined(GIT) - QString hash = GIT; - if (!hash.isEmpty()) { - title = title + "-" + hash; +#if defined(GIT) && defined(CI_VERSION) + if (title.endsWith(".99")) { + QString hash = GIT; + if (!hash.isEmpty()) { + title.append("-").append(hash); + } } #endif