Skip to content

Commit

Permalink
python,cmake: update version script to support rc
Browse files Browse the repository at this point in the history
  • Loading branch information
vicentebolea committed Jan 2, 2024
1 parent 68f8b41 commit c0c88dd
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_revision "90000+${ver_ncommits}")
set(adios2_pip_package_version "${ver_tag}.${ver_revision}")
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_revision "(1000+${ver_rc})+${ver_ncommits}")
set(adios2_pip_package_version "${ver_tag}.${ver_revision}")
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 c0c88dd

Please sign in to comment.