From bc3063f5bb1dd931ef85ea02b71e87d65b0dc09b Mon Sep 17 00:00:00 2001 From: Chris Cowan Date: Fri, 11 Jul 2025 10:37:01 -0700 Subject: [PATCH] Set correct git tag in CI --- .github/workflows/continuous_integration.yml | 7 +++++- tools/updaterevision/UpdateRevision.cmake | 24 ++++++++++++-------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 9884280d70f..f2495a879fa 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -73,7 +73,11 @@ jobs: wget -q "https://github.com/coelckers/gzdoom/releases/download/ci_deps/${ZMUSIC_PACKAGE}" tar -xf "${ZMUSIC_PACKAGE}" fi - + + - name: Git describe + id: ghd + uses: proudust/gh-describe@v2 + - name: Configure shell: bash run: | @@ -82,6 +86,7 @@ jobs: - name: Build shell: bash run: | + export GIT_DESCRIBE="${{ steps.ghd.outputs.describe }}" export MAKEFLAGS=--keep-going cmake --build build --config ${{ matrix.config.build_type }} --parallel 3 diff --git a/tools/updaterevision/UpdateRevision.cmake b/tools/updaterevision/UpdateRevision.cmake index 619a86862a4..61da4c4bdf8 100644 --- a/tools/updaterevision/UpdateRevision.cmake +++ b/tools/updaterevision/UpdateRevision.cmake @@ -15,16 +15,20 @@ endmacro() # Populate variables "Hash", "Tag", and "Timestamp" with relevant information # from source repository. If anything goes wrong return something in "Error." function(query_repo_info) - execute_process( - COMMAND git describe --tags --dirty=-m - RESULT_VARIABLE Error - OUTPUT_VARIABLE Tag - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if(NOT "${Error}" STREQUAL "0") - ret_var(Error) - return() + if(DEFINED ENV{GIT_DESCRIBE}) + set(Tag "$ENV{GIT_DESCRIBE}") + else() + execute_process( + COMMAND git describe --tags --dirty=-m + RESULT_VARIABLE Error + OUTPUT_VARIABLE Tag + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(NOT "${Error}" STREQUAL "0") + ret_var(Error) + return() + endif() endif() execute_process(