-
-
Notifications
You must be signed in to change notification settings - Fork 39.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add json index of files to CI uploads (#24097)
- Loading branch information
Showing
4 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
*.stackdump | ||
*.sym | ||
index.html | ||
firmware_list.json | ||
|
||
# QMK-specific | ||
api_data/v1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters