From ecc9e5ea99c2d66f06b31c06411a76e420ce28e8 Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:30:12 +0100 Subject: [PATCH] Try 4 --- .github/workflows/compile.yaml | 14 ++-------- index.html => _site/index.html | 0 _site/manifest.json | 27 ++++++++++++++++++ _site/manifest_wipe.json | 10 +++++++ generate_manifest.py | 50 ---------------------------------- 5 files changed, 40 insertions(+), 61 deletions(-) rename index.html => _site/index.html (100%) create mode 100644 _site/manifest.json create mode 100644 _site/manifest_wipe.json delete mode 100644 generate_manifest.py diff --git a/.github/workflows/compile.yaml b/.github/workflows/compile.yaml index b9f1a7b..53c812a 100644 --- a/.github/workflows/compile.yaml +++ b/.github/workflows/compile.yaml @@ -30,7 +30,6 @@ jobs: - name: Make output dir run: | mkdir -p output - mkdir -p _site - name: Build Binary run: | @@ -39,20 +38,13 @@ jobs: cp ./CYD-Klipper-Display/.pio/build/esp32dev/firmware.bin output cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin output python3 -m esptool --chip esp32 merge_bin -o ./output/merged-firmware.bin --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 ./output/bootloader.bin 0x8000 ./output/partitions.bin 0xe000 ./output/boot_app0.bin 0x10000 ./output/firmware.bin - + cp -r ./output ./_site + - name: Upload artifact uses: actions/upload-artifact@v3 with: name: firmware - path: ./output - - - name: Make webpage - run: | - cp -r ./output ./_site - python3 generate_manifest.py - cp manifest.json ./_site - cp manifest_wipe.json ./_site - cp index.html ./_site + path: ./output - name: Upload GitHub Page Artifact uses: actions/upload-pages-artifact@v2 diff --git a/index.html b/_site/index.html similarity index 100% rename from index.html rename to _site/index.html diff --git a/_site/manifest.json b/_site/manifest.json new file mode 100644 index 0000000..053e058 --- /dev/null +++ b/_site/manifest.json @@ -0,0 +1,27 @@ +{ + "name": "CYD-Klipper-Display", + "new_install_prompt_erase": false, + "builds": [ + { + "chipFamily": "ESP32", + "parts": [ + { + "path": "output/bootloader.bin", + "offset": 4096 + }, + { + "path": "output/partitions.bin", + "offset": 32768 + }, + { + "path": "output/boot_app0.bin", + "offset": 57344 + }, + { + "path": "output/firmware.bin", + "offset": 65536 + } + ] + } + ] +} \ No newline at end of file diff --git a/_site/manifest_wipe.json b/_site/manifest_wipe.json new file mode 100644 index 0000000..3e065f3 --- /dev/null +++ b/_site/manifest_wipe.json @@ -0,0 +1,10 @@ +{ + "name": "CYD-Klipper-Display", + "new_install_prompt_erase": false, + "builds": [ + { + "path": "output/merged-firmware.bin", + "offset": 0 + } + ] +} \ No newline at end of file diff --git a/generate_manifest.py b/generate_manifest.py deleted file mode 100644 index 9702f99..0000000 --- a/generate_manifest.py +++ /dev/null @@ -1,50 +0,0 @@ -import subprocess, json - -latest_tag = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"]) - -data_without_wipe = { - "name": "CYD-Klipper-Display", - "new_install_prompt_erase": False, - "version": latest_tag.decode("utf-8").strip(), - "builds": [ - { - "chipFamily": "ESP32", - "parts": [ - { - "path": "output/bootloader.bin", - "offset": 4096 - }, - { - "path": "output/partitions.bin", - "offset": 32768 - }, - { - "path": "output/boot_app0.bin", - "offset": 57344 - }, - { - "path": "output/firmware.bin", - "offset": 65536 - } - ] - } - ] -} - -data_with_wipe = { - "name": "CYD-Klipper-Display", - "new_install_prompt_erase": False, - "version": latest_tag.decode("utf-8").strip(), - "builds": [ - { - "path": "output/merged-firmware.bin", - "offset": 0 - } - ] -} - -with open("manifest.json", "w") as f: - json.dump(data_without_wipe, f, indent=4) - -with open("manifest_wipe.json", "w") as f: - json.dump(data_with_wipe, f, indent=4) \ No newline at end of file