mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-15 02:25:59 +01:00
internal: add tag to version, send hash in release ci
This commit is contained in:
parent
49f9ca06c7
commit
5ce76cd0b0
4 changed files with 16 additions and 4 deletions
4
.github/workflows/release.yaml
vendored
4
.github/workflows/release.yaml
vendored
|
@ -17,7 +17,9 @@ jobs:
|
||||||
|
|
||||||
- name: Create tarball with submodules
|
- name: Create tarball with submodules
|
||||||
id: tar
|
id: tar
|
||||||
run: mkdir hyprland-source; mv ./* ./hyprland-source || tar -czv --owner=0 --group=0 --no-same-owner --no-same-permissions -f source.tar.gz *
|
run: |
|
||||||
|
sed -i "1s/^/#define GIT_COMMIT_HASH $(git rev-parse HEAD)\n#define GIT_TAG \"$(git describe --tags)\"\n/" ./src/defines.hpp
|
||||||
|
mkdir hyprland-source; mv ./* ./hyprland-source || tar -czv --owner=0 --group=0 --no-same-owner --no-same-permissions -f source.tar.gz *
|
||||||
|
|
||||||
- id: whatrelease
|
- id: whatrelease
|
||||||
name: Get latest release
|
name: Get latest release
|
||||||
|
|
|
@ -43,6 +43,12 @@ execute_process(
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
OUTPUT_VARIABLE GIT_DIRTY
|
OUTPUT_VARIABLE GIT_DIRTY
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND sh -c "git describe --tags"
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
|
OUTPUT_VARIABLE GIT_TAG
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
@ -134,7 +140,8 @@ target_compile_definitions(Hyprland
|
||||||
"GIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\""
|
"GIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\""
|
||||||
"GIT_BRANCH=\"${GIT_BRANCH}\""
|
"GIT_BRANCH=\"${GIT_BRANCH}\""
|
||||||
"GIT_COMMIT_MESSAGE=\"${GIT_COMMIT_MESSAGE}\""
|
"GIT_COMMIT_MESSAGE=\"${GIT_COMMIT_MESSAGE}\""
|
||||||
"GIT_DIRTY=\"${GIT_DIRTY}\"")
|
"GIT_DIRTY=\"${GIT_DIRTY}\""
|
||||||
|
"GIT_TAG=\"${GIT_TAG}\"")
|
||||||
|
|
||||||
target_link_libraries(Hyprland rt)
|
target_link_libraries(Hyprland rt)
|
||||||
|
|
||||||
|
|
|
@ -608,8 +608,8 @@ std::string bindsRequest(HyprCtl::eHyprCtlOutputFormat format) {
|
||||||
std::string versionRequest(HyprCtl::eHyprCtlOutputFormat format) {
|
std::string versionRequest(HyprCtl::eHyprCtlOutputFormat format) {
|
||||||
|
|
||||||
if (format == HyprCtl::eHyprCtlOutputFormat::FORMAT_NORMAL) {
|
if (format == HyprCtl::eHyprCtlOutputFormat::FORMAT_NORMAL) {
|
||||||
std::string result = "Hyprland, built from branch " + std::string(GIT_BRANCH) + " at commit " + GIT_COMMIT_HASH + GIT_DIRTY + " (" +
|
std::string result = "Hyprland, built from branch " + std::string(GIT_BRANCH) + " at commit " + GIT_COMMIT_HASH + " " + GIT_DIRTY + " (" +
|
||||||
removeBeginEndSpacesTabs(GIT_COMMIT_MESSAGE).c_str() + ").\nflags: (if any)\n";
|
removeBeginEndSpacesTabs(GIT_COMMIT_MESSAGE).c_str() + ").\nTag: " + GIT_TAG + "\n\nflags: (if any)\n";
|
||||||
|
|
||||||
#ifdef LEGACY_RENDERER
|
#ifdef LEGACY_RENDERER
|
||||||
result += "legacyrenderer\n";
|
result += "legacyrenderer\n";
|
||||||
|
|
|
@ -86,6 +86,9 @@
|
||||||
#ifndef GIT_DIRTY
|
#ifndef GIT_DIRTY
|
||||||
#define GIT_DIRTY "?"
|
#define GIT_DIRTY "?"
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef GIT_TAG
|
||||||
|
#define GIT_TAG "?"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SPECIAL_WORKSPACE_START (-99)
|
#define SPECIAL_WORKSPACE_START (-99)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue