Skip to content

Commit

Permalink
python,cmake: update version script to support rc
Browse files Browse the repository at this point in the history
(cherry picked from commit 19a7c35)
  • Loading branch information
vicentebolea committed Jan 9, 2024
1 parent 68f8b41 commit f893319
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion scripts/ci/gh-actions/config/adios-version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,17 @@ else()
elseif (out MATCHES "^v([^-]*)-([^-]*)-g[a-f0-9]*")
set(ver_tag ${CMAKE_MATCH_1})
set(ver_ncommits ${CMAKE_MATCH_2})
set(adios2_pip_package_version "${ver_tag}.${ver_ncommits}")
math(EXPR ver_tweak "100000+${ver_ncommits}")
set(adios2_pip_package_version "${ver_tag}.${ver_tweak}")
elseif (out MATCHES "^v([^-]*)-rc([0-9]*)(-([^-]*)-g[a-f0-9]*)?")
set(ver_tag ${CMAKE_MATCH_1})
set(ver_rc ${CMAKE_MATCH_2})
set(ver_ncommits 0)
if (CMAKE_MATCH_COUNT EQUAL 4)
set(ver_ncommits ${CMAKE_MATCH_4})
endif()
math(EXPR ver_tweak "(1000*${ver_rc})+${ver_ncommits}")
set(adios2_pip_package_version "${ver_tag}.${ver_tweak}")
endif()
endif()
if (NOT res EQUAL 0 OR out MATCHES "fatal: not a git repository")
Expand All @@ -46,4 +56,5 @@ else()
endif()
endif()

message(${adios2_pip_package_version})
file(WRITE "VERSION.TXT" ${adios2_pip_package_version})

0 comments on commit f893319

Please sign in to comment.