ci/utils.py
raw| 1 | import re |
| 2 | |
| 3 | def get_project_version_str(): |
| 4 | regex = re.compile(r" +version: '(\d+\.\d+\.\d+)',") |
| 5 | with open("meson.build") as f: |
| 6 | for line in f.readlines(): |
| 7 | matches = regex.match(line) |
| 8 | if matches is not None: |
| 9 | version_str = matches.group(1) |
| 10 | return version_str |
| 11 | |
| 12 | raise Exception('meson.build does not have a version string for the project') |