Skip to content

Commit 7b35e61

Browse files
authored
Update version calulation for interim build version (#2493)
## Fixes - Arm-Debug/mcu-assets-dashboard#120 ## Checklist <!-- Put an `x` in the boxes. All tasks must be completed and boxes checked before merging. --> - [x] 🤖 This change is covered by unit tests (if applicable). - [x] 🤹 Manual testing has been performed (if necessary). - [x] 🛡️ Security impacts have been considered (if relevant). - [ ] 📖 Documentation updates are complete (if required). - [ ] 🧠 Third-party dependencies and TPIP updated (if required).
1 parent 87f92b5 commit 7b35e61

6 files changed

Lines changed: 16 additions & 4 deletions

File tree

.github/workflows/buildmgr.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
paths:
66
- '.github/workflows/buildmgr.yml'
77
- '.github/matrix_includes_buildmgr.json'
8+
- 'cmake/**'
89
- 'CMakeLists.txt'
910
- 'libs/crossplatform/**'
1011
- 'libs/errlog/**'
@@ -23,6 +24,7 @@ on:
2324
paths:
2425
- '.github/workflows/buildmgr.yml'
2526
- '.github/matrix_includes_buildmgr.json'
27+
- 'cmake/**'
2628
- 'CMakeLists.txt'
2729
- 'libs/**'
2830
- 'tools/buildmgr/**'
@@ -91,7 +93,7 @@ jobs:
9193
sudo apt-get update
9294
sudo apt-get install binutils-aarch64-linux-gnu
9395
94-
- name: Strip projmgr release binary
96+
- name: Strip cbuildgen release binary
9597
if: |
9698
github.event_name == 'release' &&
9799
(startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu'))

.github/workflows/packchk.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- '.github/workflows/packchk.yml'
99
- '.github/workflows/unit_test_results.yml'
1010
- '.github/matrix_includes_packchk.json'
11+
- 'cmake/**'
1112
- 'CMakeLists.txt'
1213
- 'tools/packchk/**'
1314
- 'libs/xml**'
@@ -23,6 +24,7 @@ on:
2324
- '.github/workflows/packchk.yml'
2425
- '.github/workflows/unit_test_results.yml'
2526
- '.github/matrix_includes_packchk.json'
27+
- 'cmake/**'
2628
- 'CMakeLists.txt'
2729
- 'tools/packchk/**'
2830
- 'libs/xml**'

.github/workflows/packgen.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
paths:
88
- '.github/workflows/packgen.yml'
99
- '.github/matrix_includes_packgen.json'
10+
- 'cmake/**'
1011
- 'CMakeLists.txt'
1112
- 'libs/crossplatform/**'
1213
- 'libs/rtefsutils/**'
@@ -20,6 +21,7 @@ on:
2021
paths:
2122
- '.github/workflows/packgen.yml'
2223
- '.github/matrix_includes_packgen.json'
24+
- 'cmake/**'
2325
- 'CMakeLists.txt'
2426
- 'libs/crossplatform/**'
2527
- 'libs/rtefsutils/**'

.github/workflows/projmgr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
paths:
88
- '.github/workflows/projmgr.yml'
99
- '.github/matrix_includes_projmgr.json'
10+
- 'cmake/**'
1011
- 'CMakeLists.txt'
1112
- 'libs/crossplatform/**'
1213
- 'libs/rtefsutils/**'
@@ -22,6 +23,7 @@ on:
2223
paths:
2324
- '.github/workflows/projmgr.yml'
2425
- '.github/matrix_includes_projmgr.json'
26+
- 'cmake/**'
2527
- 'CMakeLists.txt'
2628
- 'libs/crossplatform/**'
2729
- 'libs/rtefsutils/**'

.github/workflows/svdconv.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- '.github/workflows/svdconv.yml'
1111
- '.github/workflows/unit_test_results.yml'
1212
- '.github/matrix_includes_svdconv.json'
13+
- 'cmake/**'
1314
- 'CMakeLists.txt'
1415
- 'tools/svdconv/**'
1516
- 'libs/xml**'
@@ -20,6 +21,7 @@ on:
2021
- '.github/workflows/svdconv.yml'
2122
- '.github/workflows/unit_test_results.yml'
2223
- '.github/matrix_includes_svdconv.json'
24+
- 'cmake/**'
2325
- 'CMakeLists.txt'
2426
- 'tools/svdconv/**'
2527
- 'libs/xml**'

cmake/ProjectVersionFromGitTag.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ function(get_version_from_git_tag _prefix)
3838

3939
if(DESCRIBE MATCHES "^${_prefix}[0-9]+\\.[0-9]+(\\.[0-9]+)?(-[a-zA-Z][a-zA-Z0-9-\\.]*)(-[0-9]+-g[0-9a-f]+)?$")
4040
# Version with PreRelease info
41+
math(EXPR VERSION_PATCH_FULL "${VERSION_PATCH} + 1")
4142
string(REGEX REPLACE "(-[0-9]+)(-g[0-9a-f]+)?$" "" TAG_SEGMENT_STR "${DESCRIBE}")
4243
string(REGEX REPLACE "^${_prefix}[0-9]+\\.[0-9]+\\.[0-9]+-(.*)" "\\1" VERSION_PRE_RELEASE "${TAG_SEGMENT_STR}")
4344

@@ -49,19 +50,20 @@ function(get_version_from_git_tag _prefix)
4950

5051
if(DEFINED VERSION_HASH)
5152
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_TWEAK}")
52-
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_PRE_RELEASE}+p${VERSION_TWEAK}-g${VERSION_HASH}")
53+
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH_FULL}-${VERSION_PRE_RELEASE}+p${VERSION_TWEAK}-g${VERSION_HASH}")
5354
else()
5455
get_git_head_revision(VERSION_REF VERSION_HASH)
5556
string(SUBSTRING "${VERSION_HASH}" 0 7 VERSION_HASH)
5657
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
57-
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_PRE_RELEASE}")
58+
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH_FULL}-${VERSION_PRE_RELEASE}")
5859
endif()
5960

6061
elseif(DESCRIBE MATCHES "^${_prefix}[0-9]+\\.[0-9]+\\.[0-9]+-[0-9]+-g([0-9a-f]+).*")
62+
math(EXPR VERSION_PATCH_FULL "${VERSION_PATCH} + 1")
6163
string(REGEX REPLACE "^${_prefix}[0-9]+\\.[0-9]+\\.[0-9]+-([0-9]+).*" "\\1" VERSION_TWEAK "${DESCRIBE}")
6264
string(REGEX REPLACE "^${_prefix}[0-9]+\\.[0-9]+\\.[0-9]+-[0-9]+-g([0-9a-f]+).*" "\\1" VERSION_HASH "${DESCRIBE}")
6365
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_TWEAK}")
64-
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}+p${VERSION_TWEAK}-g${VERSION_HASH}")
66+
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH_FULL}+p${VERSION_TWEAK}-g${VERSION_HASH}")
6567
else()
6668
get_git_head_revision(VERSION_REF VERSION_HASH)
6769
string(SUBSTRING "${VERSION_HASH}" 0 7 VERSION_HASH)

0 commit comments

Comments
 (0)