gen-matrix-eol-check.py 823 B

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