Skip to content

Commit 78ef850

Browse files
Macilcoelckers
authored andcommitted
Set correct git tag in CI
1 parent 50fa148 commit 78ef850

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

.github/workflows/continuous_integration.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ jobs:
7373
wget -q "https://github.com/coelckers/gzdoom/releases/download/ci_deps/${ZMUSIC_PACKAGE}"
7474
tar -xf "${ZMUSIC_PACKAGE}"
7575
fi
76-
76+
77+
- name: Git describe
78+
id: ghd
79+
uses: proudust/gh-describe@v2
80+
7781
- name: Configure
7882
shell: bash
7983
run: |
@@ -82,6 +86,7 @@ jobs:
8286
- name: Build
8387
shell: bash
8488
run: |
89+
export GIT_DESCRIBE="${{ steps.ghd.outputs.describe }}"
8590
export MAKEFLAGS=--keep-going
8691
cmake --build build --config ${{ matrix.config.build_type }} --parallel 3
8792

tools/updaterevision/UpdateRevision.cmake

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,20 @@ endmacro()
1515
# Populate variables "Hash", "Tag", and "Timestamp" with relevant information
1616
# from source repository. If anything goes wrong return something in "Error."
1717
function(query_repo_info)
18-
execute_process(
19-
COMMAND git describe --tags --dirty=-m
20-
RESULT_VARIABLE Error
21-
OUTPUT_VARIABLE Tag
22-
ERROR_QUIET
23-
OUTPUT_STRIP_TRAILING_WHITESPACE
24-
)
25-
if(NOT "${Error}" STREQUAL "0")
26-
ret_var(Error)
27-
return()
18+
if(DEFINED ENV{GIT_DESCRIBE})
19+
set(Tag "$ENV{GIT_DESCRIBE}")
20+
else()
21+
execute_process(
22+
COMMAND git describe --tags --dirty=-m
23+
RESULT_VARIABLE Error
24+
OUTPUT_VARIABLE Tag
25+
ERROR_QUIET
26+
OUTPUT_STRIP_TRAILING_WHITESPACE
27+
)
28+
if(NOT "${Error}" STREQUAL "0")
29+
ret_var(Error)
30+
return()
31+
endif()
2832
endif()
2933

3034
execute_process(

0 commit comments

Comments
 (0)