Add Git SHA to about screen and --version (#7372)
* Add Git SHA to about screen * Update ChangeLog * Fixed formatting * Use `GIT_SHA` for Git SHA * Add `GIT_SHA` env var * Use env var `GIT_SHA` * Shorten the Git SHA to 8 chars for readability * Shorten Git SHA to 8 chars * Increase Linux timeout (Fedora 39 is always slow at deps) * Update ChangeLog * Revert "Update ChangeLog" This reverts commit ac52777763571e9512e1c9b73b5cac23658d5ed2.
This commit is contained in:
parent
bfaea34291
commit
d1abddde84
5 changed files with 26 additions and 4 deletions
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
|
|
@ -22,6 +22,7 @@ on:
|
||||||
- cron: "0 5 * * *"
|
- cron: "0 5 * * *"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
GIT_SHA: ${{ github.sha }}
|
||||||
SYNERGY_VERSION: ${{ github.event.inputs.version || github.event.release.tag_name }}
|
SYNERGY_VERSION: ${{ github.event.inputs.version || github.event.release.tag_name }}
|
||||||
SYNERGY_PRODUCT_NAME: ${{ vars.SYNERGY_PRODUCT_NAME }}
|
SYNERGY_PRODUCT_NAME: ${{ vars.SYNERGY_PRODUCT_NAME }}
|
||||||
SYNERGY_PACKAGE_PREFIX: ${{ vars.SYNERGY_PACKAGE_PREFIX }}
|
SYNERGY_PACKAGE_PREFIX: ${{ vars.SYNERGY_PACKAGE_PREFIX }}
|
||||||
|
|
@ -176,7 +177,7 @@ jobs:
|
||||||
name: linux-${{ matrix.distro.name }}
|
name: linux-${{ matrix.distro.name }}
|
||||||
runs-on: ${{ matrix.distro.runs-on }}
|
runs-on: ${{ matrix.distro.runs-on }}
|
||||||
container: ${{ matrix.distro.container }}
|
container: ${{ matrix.distro.container }}
|
||||||
timeout-minutes: 10
|
timeout-minutes: 20
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# Prevent apt prompting for input.
|
# Prevent apt prompting for input.
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ Enhancements:
|
||||||
- #7364 Format all source with Clang and introduce lint workflow
|
- #7364 Format all source with Clang and introduce lint workflow
|
||||||
- #7368 Make version check URL v1-specific and configurable
|
- #7368 Make version check URL v1-specific and configurable
|
||||||
- #7369 Re-implement packaging for GitHub workflows (Linux ARM)
|
- #7369 Re-implement packaging for GitHub workflows (Linux ARM)
|
||||||
|
- #7372 Add Git SHA to about screen and --version
|
||||||
|
|
||||||
# 1.14.6
|
# 1.14.6
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,18 @@ macro(configure_definitions)
|
||||||
configure_ninja()
|
configure_ninja()
|
||||||
configure_options()
|
configure_options()
|
||||||
|
|
||||||
if(NOT DEFINED VERSION_URL)
|
if("${VERSION_URL}" STREQUAL "")
|
||||||
set(VERSION_URL "https://api.symless.com/version?version=v1")
|
set(VERSION_URL "https://api.symless.com/version?version=v1")
|
||||||
endif()
|
endif()
|
||||||
add_definitions(-DSYNERGY_VERSION_URL="${VERSION_URL}")
|
add_definitions(-DSYNERGY_VERSION_URL="${VERSION_URL}")
|
||||||
|
|
||||||
|
if(NOT "$ENV{GIT_SHA}" STREQUAL "")
|
||||||
|
# Shorten the Git SHA to 8 chars for readability
|
||||||
|
string(SUBSTRING "$ENV{GIT_SHA}" 0 8 GIT_SHA_SHORT)
|
||||||
|
message(STATUS "Short Git SHA: ${GIT_SHA_SHORT}")
|
||||||
|
add_definitions(-DGIT_SHA_SHORT="${GIT_SHA_SHORT}")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ENABLE_LICENSING)
|
if(ENABLE_LICENSING)
|
||||||
message(STATUS "Licensing enabled")
|
message(STATUS "Licensing enabled")
|
||||||
add_definitions(-DSYNERGY_ENABLE_LICENSING=1)
|
add_definitions(-DSYNERGY_ENABLE_LICENSING=1)
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,13 @@ AboutDialog::AboutDialog(MainWindow *parent, const AppConfig &config)
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
m_versionChecker.setApp(parent->appPath(config.synergycName()));
|
m_versionChecker.setApp(parent->appPath(config.synergycName()));
|
||||||
m_pLabelSynergyVersion->setText(SYNERGY_VERSION);
|
|
||||||
|
QString version = SYNERGY_VERSION;
|
||||||
|
#ifdef GIT_SHA_SHORT
|
||||||
|
version += " (" GIT_SHA_SHORT ")";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
m_pLabelSynergyVersion->setText(version);
|
||||||
|
|
||||||
QString buildDateString = QString::fromLocal8Bit(__DATE__).simplified();
|
QString buildDateString = QString::fromLocal8Bit(__DATE__).simplified();
|
||||||
QDate buildDate = QLocale("en_US").toDate(buildDateString, "MMM d yyyy");
|
QDate buildDate = QLocale("en_US").toDate(buildDateString, "MMM d yyyy");
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#if WINAPI_CARBON
|
#if WINAPI_CARBON
|
||||||
|
|
@ -79,9 +80,15 @@ void App::version() {
|
||||||
char copyrightBuffer[cpight_size];
|
char copyrightBuffer[cpight_size];
|
||||||
snprintf(copyrightBuffer, cpight_size, kCopyright, kBuildYear);
|
snprintf(copyrightBuffer, cpight_size, kCopyright, kBuildYear);
|
||||||
|
|
||||||
|
std::stringstream version;
|
||||||
|
version << kVersion;
|
||||||
|
#ifdef GIT_SHA_SHORT
|
||||||
|
version << " (" << GIT_SHA_SHORT << ")";
|
||||||
|
#endif
|
||||||
|
|
||||||
char buffer[buffer_size];
|
char buffer[buffer_size];
|
||||||
snprintf(buffer, buffer_size, "%s %s, protocol version %d.%d\n%s",
|
snprintf(buffer, buffer_size, "%s %s, protocol version %d.%d\n%s",
|
||||||
argsBase().m_pname, kVersion, kProtocolMajorVersion,
|
argsBase().m_pname, version.str().c_str(), kProtocolMajorVersion,
|
||||||
kProtocolMinorVersion, copyrightBuffer);
|
kProtocolMinorVersion, copyrightBuffer);
|
||||||
|
|
||||||
std::cout << buffer << std::endl;
|
std::cout << buffer << std::endl;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue