fix(build): properly manage versions in .versionrc.js

To properly update pyproject.toml & docs/conf.py, we should manage
several digits for version number (the 10 for VERSION_MINOR), and the
VERSION_PATCH.

Change-Id: I612338fd2896f3fe614f23d14f56d58d43318a11
Signed-off-by: Yann Gautier <yann.gautier@st.com>
This commit is contained in:
Yann Gautier 2024-02-08 19:11:14 +01:00
parent c25d1ccf1e
commit 7f74030b89

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2023, Arm Limited. All rights reserved.
* Copyright (c) 2021-2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -84,9 +84,9 @@ module.exports = {
"filename": "pyproject.toml",
"updater": {
"readVersion": function (contents) {
const _ver = contents.match(/version\s=.*"(\d)\.(\d)\.(\d)/);
const _ver = contents.match(/version\s=.*"(\d+?)\.(\d+?)\.(\d+?)/);
return `${_ver[1]}.${_ver[2]}.${_ver[2]}`;
return `${_ver[1]}.${_ver[2]}.${_ver[3]}`;
},
"writeVersion": function (contents, version) {
@ -104,9 +104,9 @@ module.exports = {
"filename": "docs/conf.py",
"updater": {
"readVersion": function (contents) {
const _ver = contents.match(/version\s=.*"(\d)\.(\d)\.(\d)/);
const _ver = contents.match(/version\s=.*"(\d+?)\.(\d+?)\.(\d+?)/);
return `${_ver[1]}.${_ver[2]}.${_ver[2]}`;
return `${_ver[1]}.${_ver[2]}.${_ver[3]}`;
},
"writeVersion": function (contents, version) {