From eca639bfb60577bc198dbbcf1b6433a976d411e7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Dec 2025 13:46:46 +0000 Subject: [PATCH 1/4] Initial plan From e851df59c25436366b9db4df971dfecc4796d032 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Dec 2025 13:58:29 +0000 Subject: [PATCH 2/4] Fix build error: Move SD.h includes to cpp and add build workflow Co-authored-by: Crashkeyz <186653592+Crashkeyz@users.noreply.github.com> --- .github/workflows/build-firmware.yml | 61 ++++++++++++++++++++++++++++ drivers/cardputer_adv_driver.h | 4 +- 2 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build-firmware.yml diff --git a/.github/workflows/build-firmware.yml b/.github/workflows/build-firmware.yml new file mode 100644 index 0000000..73293e5 --- /dev/null +++ b/.github/workflows/build-firmware.yml @@ -0,0 +1,61 @@ +name: Build Skeleton Key Firmware + +on: + push: + branches: [ main, skeleton-key-final ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Cache PlatformIO + uses: actions/cache@v3 + with: + path: | + ~/.platformio + .pio + key: ${{ runner.os }}-pio-${{ hashFiles('**/platformio.ini') }} + restore-keys: | + ${{ runner.os }}-pio- + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install PlatformIO + run: | + python -m pip install --upgrade pip + pip install platformio + + - name: Build Firmware + run: | + pio run -e m5stack-cardputer + + - name: Upload Firmware Artifact + uses: actions/upload-artifact@v4 + with: + name: skeleton-key-firmware-${{ github.sha }} + path: .pio/build/m5stack-cardputer/firmware.bin + retention-days: 30 + + - name: Upload Bootloader + uses: actions/upload-artifact@v4 + with: + name: skeleton-key-bootloader-${{ github.sha }} + path: .pio/build/m5stack-cardputer/bootloader.bin + retention-days: 30 + + - name: Upload Partitions + uses: actions/upload-artifact@v4 + with: + name: skeleton-key-partitions-${{ github.sha }} + path: .pio/build/m5stack-cardputer/partitions.bin + retention-days: 30 diff --git a/drivers/cardputer_adv_driver.h b/drivers/cardputer_adv_driver.h index 0e2c84a..018de4d 100644 --- a/drivers/cardputer_adv_driver.h +++ b/drivers/cardputer_adv_driver.h @@ -1,9 +1,7 @@ #ifndef CARDPUTER_ADV_DRIVER_H #define CARDPUTER_ADV_DRIVER_H -#include -#include - +// Forward declarations - actual includes in .cpp file void initialize_driver(); bool initialize_sd_card(); From bbe1f7303ad361ac3cfe96760fb1f446f71b1b11 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Dec 2025 13:59:30 +0000 Subject: [PATCH 3/4] Add if-no-files-found: warn for optional build artifacts Co-authored-by: Crashkeyz <186653592+Crashkeyz@users.noreply.github.com> --- .github/workflows/build-firmware.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-firmware.yml b/.github/workflows/build-firmware.yml index 73293e5..42e08a2 100644 --- a/.github/workflows/build-firmware.yml +++ b/.github/workflows/build-firmware.yml @@ -52,6 +52,7 @@ jobs: name: skeleton-key-bootloader-${{ github.sha }} path: .pio/build/m5stack-cardputer/bootloader.bin retention-days: 30 + if-no-files-found: warn - name: Upload Partitions uses: actions/upload-artifact@v4 @@ -59,3 +60,4 @@ jobs: name: skeleton-key-partitions-${{ github.sha }} path: .pio/build/m5stack-cardputer/partitions.bin retention-days: 30 + if-no-files-found: warn From a1bed45d0c128a8ae5f21602c3536a1908a03468 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 26 Dec 2025 14:00:24 +0000 Subject: [PATCH 4/4] Add explicit permissions to workflow for security Co-authored-by: Crashkeyz <186653592+Crashkeyz@users.noreply.github.com> --- .github/workflows/build-firmware.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-firmware.yml b/.github/workflows/build-firmware.yml index 42e08a2..5921ec9 100644 --- a/.github/workflows/build-firmware.yml +++ b/.github/workflows/build-firmware.yml @@ -10,6 +10,8 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Checkout code