summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2024-07-11 23:48:43 +0100
committerGitHub <noreply@github.com>2024-07-12 08:48:43 +1000
commit063f1444c68a64a02fe2f5c3de2f8fa765f53533 (patch)
tree4b3475a5c7abee5ce9286cce766758fb6c2eff1e
parent2e671cfd8be1a867cb6717732f1045fc026aeba0 (diff)
Add json index of files to CI uploads (#24097)0.25.13
-rw-r--r--.github/workflows/ci_build_major_branch.yml5
-rw-r--r--.gitignore1
-rw-r--r--util/ci/firmware_list_generator.py26
-rw-r--r--util/ci/templates/index.html.j23
4 files changed, 32 insertions, 3 deletions
diff --git a/.github/workflows/ci_build_major_branch.yml b/.github/workflows/ci_build_major_branch.yml
index 0e772c7d53..ba5d1c246f 100644
--- a/.github/workflows/ci_build_major_branch.yml
+++ b/.github/workflows/ci_build_major_branch.yml
@@ -95,11 +95,12 @@ jobs:
run: |
python3 -m pip install -r ./util/ci/requirements.txt
./util/ci/index_generator.py > index.html
+ ./util/ci/firmware_list_generator.py > firmware_list.json
- name: Upload to https://ci.qmk.fm/${{ inputs.branch || github.ref_name }}/${{ github.sha }}
uses: jakejarvis/s3-sync-action@master
with:
- args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include '*.hex' --include '*.bin' --include '*.uf2'
+ args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include 'firmware_list.json' --include '*.hex' --include '*.bin' --include '*.uf2'
env:
AWS_S3_BUCKET: ${{ vars.CI_QMK_FM_SPACES_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.CI_QMK_FM_SPACES_KEY }}
@@ -112,7 +113,7 @@ jobs:
- name: Upload to https://ci.qmk.fm/${{ inputs.branch || github.ref_name }}/latest
uses: jakejarvis/s3-sync-action@master
with:
- args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include '*.hex' --include '*.bin' --include '*.uf2'
+ args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include 'firmware_list.json' --include '*.hex' --include '*.bin' --include '*.uf2'
env:
AWS_S3_BUCKET: ${{ vars.CI_QMK_FM_SPACES_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.CI_QMK_FM_SPACES_KEY }}
diff --git a/.gitignore b/.gitignore
index 5de38c161c..c3f2f063cd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,6 +26,7 @@
*.stackdump
*.sym
index.html
+firmware_list.json
# QMK-specific
api_data/v1
diff --git a/util/ci/firmware_list_generator.py b/util/ci/firmware_list_generator.py
new file mode 100644
index 0000000000..926939f4c3
--- /dev/null
+++ b/util/ci/firmware_list_generator.py
@@ -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)
diff --git a/util/ci/templates/index.html.j2 b/util/ci/templates/index.html.j2
index 18086987db..1199a0819d 100644
--- a/util/ci/templates/index.html.j2
+++ b/util/ci/templates/index.html.j2
@@ -3,6 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <link rel="icon" href="https://qmk.fm/logo.png" />
<style type="text/css">
{{ ansi2html_styles }}
@@ -66,7 +67,7 @@
<div style="float: left">
<div class="container">
<div style="display: table-cell; vertical-align: middle;">
- <a href="https://qmk.fm/"><img src="https://qmk.fm/assets/images/badge-community-dark.svg" style="width: 30em;" /></a>
+ <a href="https://qmk.fm/"><img src="https://qmk.fm/badge-community-dark.svg" style="width: 30em;" /></a>
</div>
<div class="header-container">
<div>