1
0
Fork 0

Add json index of files to CI uploads (#24097)

This commit is contained in:
Joel Challis 2024-07-11 23:48:43 +01:00 committed by GitHub
parent 2e671cfd8b
commit 063f1444c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 32 additions and 3 deletions

View file

@ -0,0 +1,26 @@
import os
import json
from pathlib import Path
from time import gmtime, strftime
DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S %Z'
def current_datetime():
return strftime(DATETIME_FORMAT, gmtime())
qmk_firmware_dir = Path(os.path.realpath(__file__)).parents[2]
binaries = []
binaries.extend(qmk_firmware_dir.glob("*.bin"))
binaries.extend(qmk_firmware_dir.glob("*.hex"))
binaries.extend(qmk_firmware_dir.glob("*.uf2"))
binaries = list(sorted(binaries))
data = []
for binary in binaries:
data.append(binary.name)
keyboard_all_json = json.dumps({'last_updated': current_datetime(), 'files': data}, separators=(',', ':'))
print(keyboard_all_json)