[ci] use GITHUB_SHORT_SHA instead of build number in version

This commit is contained in:
dijunkun
2025-10-24 02:09:50 +08:00
parent ee5612da8b
commit 0bd27d0b17
6 changed files with 2694 additions and 2667 deletions

View File

@@ -34,10 +34,11 @@ jobs:
shell: bash
id: set_deb_version
run: |
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
if [[ ! "${VERSION_NUM}" =~ ^[0-9] ]]; then
LEGAL_VERSION="0.0.0-${VERSION_NUM}-${GITHUB_RUN_NUMBER}"
LEGAL_VERSION="0.0.0-${VERSION_NUM}-${SHORT_SHA}"
else
LEGAL_VERSION="${VERSION_NUM}-${GITHUB_RUN_NUMBER}"
LEGAL_VERSION="${VERSION_NUM}-${SHORT_SHA}"
fi
echo "LEGAL_VERSION=${LEGAL_VERSION}" >> $GITHUB_ENV
@@ -97,10 +98,11 @@ jobs:
shell: bash
id: set_deb_version
run: |
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
if [[ ! "${VERSION_NUM}" =~ ^[0-9] ]]; then
LEGAL_VERSION="0.0.0-${VERSION_NUM}-${GITHUB_RUN_NUMBER}"
LEGAL_VERSION="0.0.0-${VERSION_NUM}-${SHORT_SHA}"
else
LEGAL_VERSION="${VERSION_NUM}-${GITHUB_RUN_NUMBER}"
LEGAL_VERSION="${VERSION_NUM}-${SHORT_SHA}"
fi
echo "LEGAL_VERSION=${LEGAL_VERSION}" >> $GITHUB_ENV
@@ -157,7 +159,8 @@ jobs:
id: version
run: |
VERSION="${GITHUB_REF##*/}"
VERSION_NUM="${VERSION#v}-${GITHUB_RUN_NUMBER}"
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
VERSION_NUM="${VERSION#v}-${SHORT_SHA}"
echo "VERSION_NUM=${VERSION_NUM}" >> $GITHUB_ENV
echo "VERSION_NUM=${VERSION_NUM}"
@@ -219,7 +222,8 @@ jobs:
$version = $ref -replace '^refs/(tags|heads)/', ''
$version = $version -replace '^v', ''
$version = $version -replace '/', '-'
echo "VERSION_NUM=$version-${GITHUB_RUN_NUMBER}" >> $env:GITHUB_ENV
$SHORT_SHA = $env:GITHUB_SHA.Substring(0,7)
echo "VERSION_NUM=$version-$SHORT_SHA" >> $env:GITHUB_ENV
- name: Cache xmake dependencies
uses: actions/cache@v4
@@ -286,7 +290,7 @@ jobs:
- name: Build CrossDesk
run: |
xmake f --CROSSDESK_VERSION=${VERSION_NUM} -y
xmake f --CROSSDESK_VERSION=${{ env.VERSION_NUM }} -y
xmake b -vy crossdesk
- name: Decode and save certificate
@@ -327,7 +331,8 @@ jobs:
id: version
run: |
VERSION="${GITHUB_REF##*/}"
VERSION_NUM="${VERSION#v}-${VERSION_NUM}"
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
VERSION_NUM="${VERSION#v}-${SHORT_SHA}"
echo "VERSION_NUM=${VERSION_NUM}" >> $GITHUB_OUTPUT
- name: Rename artifacts

View File

@@ -15,8 +15,9 @@ jobs:
- name: Set version number
id: version
run: |
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
VERSION_NUM="${GITHUB_REF##*/}"
VERSION_NUM="${VERSION_NUM#v}"
VERSION_NUM="${VERSION_NUM#v}-${SHORT_SHA}"
echo "VERSION_NUM=${VERSION_NUM}" >> $GITHUB_ENV
echo "VERSION_NUM=${VERSION_NUM}" >> $GITHUB_OUTPUT

File diff suppressed because it is too large Load Diff

View File

@@ -341,8 +341,8 @@ class Render {
float connection_status_window_height_ = 150;
float notification_window_width_ = 200;
float notification_window_height_ = 80;
float about_window_width_ = 200;
float about_window_height_ = 150;
float about_window_width_ = 300;
float about_window_height_ = 170;
int screen_width_ = 1280;
int screen_height_ = 720;
int selected_display_ = 0;

View File

@@ -33,9 +33,15 @@ int Render::AboutWindow() {
version = "Unknown";
#endif
std::string text =
localization::version[localization_language_index_] + ": " + version;
std::string text = localization::version[localization_language_index_] +
": CrossDesk v" + version;
ImGui::Text("%s", text.c_str());
ImGui::Text("");
std::string copyright_text = "© 2025 by JUNKUN DI. All rights reserved.";
std::string license_text = "Licensed under GNU LGPL v3.";
ImGui::Text("%s", copyright_text.c_str());
ImGui::Text("%s", license_text.c_str());
ImGui::SetCursorPosX(about_window_width_ * 0.42f);
ImGui::SetCursorPosY(about_window_height_ * 0.75f);

View File

@@ -7,8 +7,6 @@ option("CROSSDESK_VERSION")
set_description("Set CROSSDESK_VERSION for build")
option_end()
add_defines("CROSSDESK_VERSION=\"" .. (get_config("CROSSDESK_VERSION") or "Unknown") .. "\"")
add_rules("mode.release", "mode.debug")
set_languages("c++17")
set_encodings("utf-8")
@@ -148,6 +146,7 @@ target("assets")
target("gui")
set_kind("object")
add_packages("libyuv")
add_defines("CROSSDESK_VERSION=\"" .. (get_config("CROSSDESK_VERSION") or "Unknown") .. "\"")
add_deps("rd_log", "common", "assets", "config_center", "minirtc",
"path_manager", "screen_capturer", "speaker_capturer",
"device_controller", "thumbnail")