Skip to content

Commit 1b2c560

Browse files
authored
Update code to extract versions from string (FreeRTOS#678)
This is needed to correctly handle patch versions. Signed-off-by: Gaurav Aggarwal <[email protected]>
1 parent 687c50f commit 1b2c560

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/scripts/release.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,9 @@ def __init__(self, mGit, version, commit='HEAD', git_ssh=False, git_org='FreeRTO
253253
def updateVersionMacros(self, version_str):
254254
info('Updating version macros in task.h for "%s"' % version_str)
255255

256-
# Strip out any non-numeric or '.' characters before setting major / minor / build
257-
(major, minor, build) = re.sub("[^0-9.]", "", version_str).split('.')
256+
# Extract major / minor / build from the version string.
257+
ver = re.search(r'([\d.]+)', version_str).group(1)
258+
(major, minor, build) = ver.split('.')
258259
update_freertos_version_macros(os.path.join(self.repo_path, 'include', 'task.h'), version_str, major, minor, build)
259260

260261
self.commitChanges(self.commit_msg_prefix + 'Bump task.h version macros to "%s"' % version_str)

0 commit comments

Comments
 (0)