mirror of
https://github.com/suchmememanyskill/CYD-Klipper.git
synced 2026-03-21 05:33:24 +00:00
Edit CI
This commit is contained in:
18
.github/workflows/compile.yaml
vendored
18
.github/workflows/compile.yaml
vendored
@@ -28,27 +28,17 @@ jobs:
|
|||||||
|
|
||||||
- name: Build PlatformIO Project
|
- name: Build PlatformIO Project
|
||||||
run: |
|
run: |
|
||||||
cd CYD-Klipper
|
python3 ci.py
|
||||||
pio run
|
|
||||||
|
|
||||||
- name: Make output dir
|
- name: Copy output to site
|
||||||
run: |
|
run: |
|
||||||
mkdir -p output
|
cp -r ./out ./_site
|
||||||
|
|
||||||
- name: Build Binary
|
|
||||||
run: |
|
|
||||||
cp ./CYD-Klipper/.pio/build/esp32dev/bootloader.bin output
|
|
||||||
cp ./CYD-Klipper/.pio/build/esp32dev/partitions.bin output
|
|
||||||
cp ./CYD-Klipper/.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
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: firmware
|
name: firmware
|
||||||
path: ./output
|
path: ./out
|
||||||
|
|
||||||
- name: Upload GitHub Page Artifact
|
- name: Upload GitHub Page Artifact
|
||||||
uses: actions/upload-pages-artifact@v2
|
uses: actions/upload-pages-artifact@v2
|
||||||
|
|||||||
23
ci.py
Normal file
23
ci.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import subprocess, os, shutil
|
||||||
|
|
||||||
|
CYD_PORTS = ["esp32-3248S035C", "esp32-2432S028R"]
|
||||||
|
BASE_DIR = os.getcwd()
|
||||||
|
PYTHON3 = "py" if os.name == "nt" else "python3"
|
||||||
|
|
||||||
|
|
||||||
|
if os.path.exists("out"):
|
||||||
|
shutil.rmtree("out")
|
||||||
|
|
||||||
|
for port in CYD_PORTS:
|
||||||
|
port_path = os.path.join("out", port)
|
||||||
|
os.chdir(BASE_DIR)
|
||||||
|
os.makedirs(port_path, exist_ok=True)
|
||||||
|
os.chdir("CYD-Klipper")
|
||||||
|
subprocess.run(["pio", "run", "-e", port], check=True)
|
||||||
|
os.chdir("..")
|
||||||
|
for file in ["bootloader.bin", "partitions.bin", "firmware.bin"]:
|
||||||
|
shutil.copy(f"./CYD-Klipper/.pio/build/{port}/{file}", f"{port_path}/{file}")
|
||||||
|
|
||||||
|
shutil.copy(os.path.join(os.path.expanduser("~"), ".platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin"), f"{port_path}/boot_app0.bin")
|
||||||
|
os.chdir(port_path)
|
||||||
|
subprocess.run([PYTHON3, "-m", "esptool", "--chip", "esp32", "merge_bin", "-o", "merged_firmware.bin", "--flash_mode", "dio", "--flash_freq", "40m", "--flash_size", "4MB", "0x1000", "bootloader.bin", "0x8000", "partitions.bin", "0xe000", "boot_app0.bin", "0x10000", "firmware.bin"], check=True)
|
||||||
Reference in New Issue
Block a user