summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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:
95 run: | 95 run: |
96 python3 -m pip install -r ./util/ci/requirements.txt 96 python3 -m pip install -r ./util/ci/requirements.txt
97 ./util/ci/index_generator.py > index.html 97 ./util/ci/index_generator.py > index.html
98 ./util/ci/firmware_list_generator.py > firmware_list.json
98 99
99 - name: Upload to https://ci.qmk.fm/${{ inputs.branch || github.ref_name }}/${{ github.sha }} 100 - name: Upload to https://ci.qmk.fm/${{ inputs.branch || github.ref_name }}/${{ github.sha }}
100 uses: jakejarvis/s3-sync-action@master 101 uses: jakejarvis/s3-sync-action@master
101 with: 102 with:
102 args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include '*.hex' --include '*.bin' --include '*.uf2' 103 args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include 'firmware_list.json' --include '*.hex' --include '*.bin' --include '*.uf2'
103 env: 104 env:
104 AWS_S3_BUCKET: ${{ vars.CI_QMK_FM_SPACES_BUCKET }} 105 AWS_S3_BUCKET: ${{ vars.CI_QMK_FM_SPACES_BUCKET }}
105 AWS_ACCESS_KEY_ID: ${{ secrets.CI_QMK_FM_SPACES_KEY }} 106 AWS_ACCESS_KEY_ID: ${{ secrets.CI_QMK_FM_SPACES_KEY }}
@@ -112,7 +113,7 @@ jobs:
112 - name: Upload to https://ci.qmk.fm/${{ inputs.branch || github.ref_name }}/latest 113 - name: Upload to https://ci.qmk.fm/${{ inputs.branch || github.ref_name }}/latest
113 uses: jakejarvis/s3-sync-action@master 114 uses: jakejarvis/s3-sync-action@master
114 with: 115 with:
115 args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include '*.hex' --include '*.bin' --include '*.uf2' 116 args: --acl public-read --follow-symlinks --delete --exclude '*' --include 'index.html' --include 'firmware_list.json' --include '*.hex' --include '*.bin' --include '*.uf2'
116 env: 117 env:
117 AWS_S3_BUCKET: ${{ vars.CI_QMK_FM_SPACES_BUCKET }} 118 AWS_S3_BUCKET: ${{ vars.CI_QMK_FM_SPACES_BUCKET }}
118 AWS_ACCESS_KEY_ID: ${{ secrets.CI_QMK_FM_SPACES_KEY }} 119 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 @@
26*.stackdump 26*.stackdump
27*.sym 27*.sym
28index.html 28index.html
29firmware_list.json
29 30
30# QMK-specific 31# QMK-specific
31api_data/v1 32api_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 @@
1import os
2import json
3from pathlib import Path
4from time import gmtime, strftime
5
6DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S %Z'
7
8def current_datetime():
9 return strftime(DATETIME_FORMAT, gmtime())
10
11
12qmk_firmware_dir = Path(os.path.realpath(__file__)).parents[2]
13
14binaries = []
15binaries.extend(qmk_firmware_dir.glob("*.bin"))
16binaries.extend(qmk_firmware_dir.glob("*.hex"))
17binaries.extend(qmk_firmware_dir.glob("*.uf2"))
18binaries = list(sorted(binaries))
19
20data = []
21for binary in binaries:
22 data.append(binary.name)
23
24keyboard_all_json = json.dumps({'last_updated': current_datetime(), 'files': data}, separators=(',', ':'))
25
26print(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 @@
3 3
4<head> 4<head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <link rel="icon" href="https://qmk.fm/logo.png" />
6 <style type="text/css"> 7 <style type="text/css">
7 {{ ansi2html_styles }} 8 {{ ansi2html_styles }}
8 9
@@ -66,7 +67,7 @@
66 <div style="float: left"> 67 <div style="float: left">
67 <div class="container"> 68 <div class="container">
68 <div style="display: table-cell; vertical-align: middle;"> 69 <div style="display: table-cell; vertical-align: middle;">
69 <a href="https://qmk.fm/"><img src="https://qmk.fm/assets/images/badge-community-dark.svg" style="width: 30em;" /></a> 70 <a href="https://qmk.fm/"><img src="https://qmk.fm/badge-community-dark.svg" style="width: 30em;" /></a>
70 </div> 71 </div>
71 <div class="header-container"> 72 <div class="header-container">
72 <div> 73 <div>