Skip to content

Commit

Permalink
Merge pull request #282 from vkedwardli/fix-git-tagging
Browse files Browse the repository at this point in the history
Fix git tagging
  • Loading branch information
inada-s authored Jan 12, 2025
2 parents a3a1538 + c4e92ed commit ff62a09
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ jobs:
- name: Upload symbols to Sentry (Windows, macOS, Linux)
run: |
VERSION=$(git describe --tags --always --match "gdxsv-*" | sed -E "s/-([0-9]+)-g(.+)$/-dev.\\1+\\2/g")
# Auto increment semver if it is prelease, since 1.2.3-beta.1 < 1.2.3
if [[ "$VERSION" =~ \.([0-9]+)-dev.[0-9]+\+ ]]; then
PATCH_VERSION="${BASH_REMATCH[1]}"
PATCH_VERSION=$((PATCH_VERSION + 1))
VERSION=$(echo "$VERSION" | sed -E "s/.[0-9]-dev/.${PATCH_VERSION}-dev/")
fi
sentry-cli releases new "$VERSION"
sentry-cli releases set-commits "$VERSION" --auto
sentry-cli debug-files upload symbols
Expand Down
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,14 @@ endif()

find_package(Git)
if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
if(MINGW)
set(GDXSV_PATTERN "gdxsv-\\*")
else()
set(GDXSV_PATTERN """gdxsv-*""")
endif()
message(GDXSV_PATTERN="${GDXSV_PATTERN}")
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --tags --always
COMMAND ${GIT_EXECUTABLE} describe --tags --always --match ${GDXSV_PATTERN}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
Expand Down

0 comments on commit ff62a09

Please sign in to comment.