| 1 | #!/usr/bin/env python3 |
| 2 | '''Generate the build matrix for the EOL check jobs.''' |
| 3 | |
| 4 | import json |
| 5 | |
| 6 | from ruamel.yaml import YAML |
| 7 | |
| 8 | yaml = YAML(typ='safe') |
| 9 | entries = list() |
| 10 | |
| 11 | with open('.github/data/distros.yml') as f: |
| 12 | data = yaml.load(f) |
| 13 | |
| 14 | for item in data['include']: |
| 15 | if 'eol_check' in item and item['eol_check']: |
| 16 | if isinstance(item['eol_check'], str): |
| 17 | distro = item['eol_check'] |
| 18 | else: |
| 19 | distro = item['distro'] |
| 20 | |
| 21 | entries.append({ |
| 22 | 'distro': distro, |
| 23 | 'release': item['version'], |
| 24 | 'full_name': f'{ item["distro"] } { item["version"] }', |
| 25 | 'lts': 1 if 'eol_lts' in item and item['eol_lts'] else 0, |
| 26 | }) |
| 27 | |
| 28 | entries.sort(key=lambda k: (k['distro'], k['release'])) |
| 29 | matrix = json.dumps({'include': entries}, sort_keys=True) |
| 30 | print(matrix) |