diff --git a/.github/workflows/PR_All_envs.yml b/.github/workflows/PR_All_envs.yml index d2b231da0..7dd47e6a5 100644 --- a/.github/workflows/PR_All_envs.yml +++ b/.github/workflows/PR_All_envs.yml @@ -11,201 +11,56 @@ on: jobs: compile_sketch: - name: Build ${{ matrix.board.name }} + name: Build ${{ matrix.board.env }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: board: - - { - vendor: "M5Stack", - name: "Cardputer", - env: "m5stack-cardputer", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0000" }, - } - - { - vendor: "M5Stack", - name: "StickCPlus2", - env: "m5stack-cplus2", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "M5Stack", - name: "StickCPlus 1.1", - env: "m5stack-cplus1_1", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "LAUNCHER", - name: "M5StickCPlus 1.1", - env: "LAUNCHER_m5stack-cplus1_1", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "M5Stack", - name: "Core2", - env: "m5stack-core2", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "M5Stack", - name: "Core16mb", - env: "m5stack-core16mb", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "M5Stack", - name: "Core4mb", - env: "m5stack-core4mb", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "M5Stack", - name: "CoreS3", - env: "m5stack-cores3", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "ESP32", - name: "ESP32-S3", - env: "esp32-s3-devkitc-1", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "CYD", - name: "CYD-2432S028", - env: "CYD-2432S028", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "CYD", - name: "CYD-2432S028 (2USB or inverted Colors)", - env: "CYD-2USB", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "CYD", - name: "CYD-2432W328C", - env: "CYD-2432W328C", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "CYD", - name: "CYD-2432W328C (inv colors) and CYD-2432S024C", - env: "CYD-2432W328C_2", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "CYD", - name: "CYD-2432W328R or 2432S024R", - env: "CYD-2432W328R-or-S024R", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "LAUNCHER", - name: "CYD-2432W328R or 2432S024R", - env: "LAUNCHER_CYD-2432W328R-or-S024R", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "LAUNCHER", - name: "CYD-2432S028", - env: "LAUNCHER_CYD-2432S028", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "LAUNCHER", - name: "CYD-2432S028 (2USB or Inverted Colors)", - env: "LAUNCHER_CYD-2USB", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "LAUNCHER", - name: "CYD-2432W328C", - env: "LAUNCHER_CYD-2432W328C", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Embed CC1101", - env: "lilygo-t-embed-cc1101", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Embed", - env: "lilygo-t-embed", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Deck", - env: "lilygo-t-deck", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Watch S3", - env: "lilygo-t-watch-s3", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Deck-Plus", - env: "lilygo-t-deck-pro", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Display-S3", - env: "lilygo-t-display-s3", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Display-S3 Touch", - env: "lilygo-t-display-s3-touch", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-LoRa-Pager", - env: "lilygo-t-lora-pager", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Smoochiee", - name: "Smoochiee-Board", - env: "smoochiee-board", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } + - { env: "m5stack-cardputer", family: "ESP32-S3",} + - { env: "m5stack-cplus2", family: "ESP32",} + - { env: "m5stack-cplus1_1", family: "ESP32",} + - { env: "LAUNCHER_m5stack-cplus1_1", family: "ESP32",} + - { env: "m5stack-core2", family: "ESP32",} + - { env: "m5stack-core16mb", family: "ESP32",} + - { env: "m5stack-core4mb", family: "ESP32",} + - { env: "m5stack-cores3", family: "ESP32-S3",} + - { env: "esp32-s3-devkitc-1", family: "ESP32-S3",} + - { env: "CYD-2432S028", family: "ESP32",} + - { env: "CYD-2USB", family: "ESP32",} + - { env: "CYD-2432W328C", family: "ESP32",} + - { env: "CYD-2432W328C_2", family: "ESP32",} + - { env: "CYD-2432W328R-or-S024R", family: "ESP32",} + - { env: "LAUNCHER_CYD-2432W328R-or-S024R", family: "ESP32",} + - { env: "LAUNCHER_CYD-2432S028", family: "ESP32",} + - { env: "LAUNCHER_CYD-2USB", family: "ESP32",} + - { env: "LAUNCHER_CYD-2432W328C", family: "ESP32",} + - { env: "lilygo-t-embed-cc1101", family: "ESP32-S3",} + - { env: "lilygo-t-embed", family: "ESP32-S3",} + - { env: "lilygo-t-deck", family: "ESP32-S3",} + - { env: "lilygo-t-watch-s3", family: "ESP32-S3",} + - { env: "lilygo-t-deck-pro", family: "ESP32-S3",} + - { env: "lilygo-t-display-s3", family: "ESP32-S3",} + - { env: "lilygo-t-display-s3-touch", family: "ESP32-S3",} + - { env: "lilygo-t-display-s3-mmc", family: "ESP32-S3",} + - { env: "lilygo-t-display-s3-touch-mmc", family: "ESP32-S3",} + - { env: "lilygo-t-display-S3-pro", family: "ESP32-S3",} + - { env: "lilygo-t-display-ttgo", family: "ESP32",} + - { env: "lilygo-t-hmi", family: "ESP32-S3",} + - { env: "lilygo-t-lora-pager", family: "ESP32-S3",} + - { env: "smoochiee-board", family: "ESP32-S3",} + - { env: "Phantom_S024R", family: "ESP32",} + - { env: "LAUNCHER_Phantom_S024R", family: "ESP32",} + - { env: "Marauder-Mini", family: "ESP32",} + - { env: "LAUNCHER_Marauder-Mini", family: "ESP32",} + - { env: "Awok-Mini", family: "ESP32",} + - { env: "Marauder-v7", family: "ESP32",} + - { env: "LAUNCHER_Marauder-v7", family: "ESP32",} + - { env: "Marauder-V4-V6", family: "ESP32",} + - { env: "Marauder-v61", family: "ESP32",} + - { env: "LAUNCHER_Marauder-V4-V6", family: "ESP32",} + - { env: "LAUNCHER_Marauder-v61", family: "ESP32",} + - { env: "Awok-Touch", family: "ESP32",} steps: - uses: actions/checkout@v4 with: @@ -267,11 +122,11 @@ jobs: ${{ github.workspace }}/.pio key: Bruce-pio-${{ matrix.board.env }}-${{ github.run_id }}-${{ github.run_attempt }} - - name: Merge Files - run: | - pio run -e ${{ matrix.board.env }} -t build-firmware + # - name: Merge Files + # run: | + # pio run -e ${{ matrix.board.env }} -t build-firmware - - name: Upload ${{ matrix.board.name }} + - name: Upload ${{ matrix.board.env }} uses: actions/upload-artifact@v4 with: name: Bruce-${{ matrix.board.env }} diff --git a/.github/workflows/PR_check.yml b/.github/workflows/PR_check.yml index 265e16a53..1626ac001 100644 --- a/.github/workflows/PR_check.yml +++ b/.github/workflows/PR_check.yml @@ -107,9 +107,9 @@ jobs: ${{ github.workspace }}/.pio key: Bruce-pio-${{ matrix.board.env }}-${{ github.run_id }}-${{ github.run_attempt }} - - name: Merge Files - run: | - pio run -e ${{ matrix.board.env }} -t build-firmware + # - name: Merge Files + # run: | + # pio run -e ${{ matrix.board.env }} -t build-firmware - name: Upload ${{ matrix.board.name }} uses: actions/upload-artifact@v4 diff --git a/.github/workflows/buil_parallel.yml b/.github/workflows/buil_parallel.yml index 2a93c3046..159c528a8 100644 --- a/.github/workflows/buil_parallel.yml +++ b/.github/workflows/buil_parallel.yml @@ -3,328 +3,65 @@ name: Build and Push Releases on: push: - # branches: - # - main + branches: + - main, workflow tags: - "*" workflow_dispatch: jobs: compile_sketch: - name: Build ${{ matrix.board.name }} + name: Build ${{ matrix.board.env }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: board: - - { - vendor: "M5Stack", - name: "Cardputer", - env: "m5stack-cardputer", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0000" }, - } - - { - vendor: "M5Stack", - name: "StickCPlus2", - env: "m5stack-cplus2", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "M5Stack", - name: "StickCPlus 1.1", - env: "m5stack-cplus1_1", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "LAUNCHER", - name: "M5StickCPlus 1.1", - env: "LAUNCHER_m5stack-cplus1_1", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "M5Stack", - name: "Core2", - env: "m5stack-core2", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "M5Stack", - name: "Core16mb", - env: "m5stack-core16mb", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "M5Stack", - name: "Core4mb", - env: "m5stack-core4mb", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "M5Stack", - name: "CoreS3", - env: "m5stack-cores3", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "ESP32", - name: "ESP32-S3", - env: "esp32-s3-devkitc-1", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "CYD", - name: "CYD-2432S028", - env: "CYD-2432S028", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "CYD", - name: "CYD-2432S028 (2USB or inverted Colors)", - env: "CYD-2USB", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "CYD", - name: "CYD-2432W328C", - env: "CYD-2432W328C", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "CYD", - name: "CYD-2432W328C (inv colors) and CYD-2432S024C", - env: "CYD-2432W328C_2", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "CYD", - name: "CYD-2432W328R or 2432S024R", - env: "CYD-2432W328R-or-S024R", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "LAUNCHER", - name: "CYD-2432W328R or 2432S024R", - env: "LAUNCHER_CYD-2432W328R-or-S024R", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "LAUNCHER", - name: "CYD-2432S028", - env: "LAUNCHER_CYD-2432S028", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "LAUNCHER", - name: "CYD-2432S028 (2USB or Inverted Colors)", - env: "LAUNCHER_CYD-2USB", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "LAUNCHER", - name: "CYD-2432W328C", - env: "LAUNCHER_CYD-2432W328C", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Embed CC1101", - env: "lilygo-t-embed-cc1101", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Embed", - env: "lilygo-t-embed", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Deck", - env: "lilygo-t-deck", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Watch S3", - env: "lilygo-t-watch-s3", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Deck-Plus", - env: "lilygo-t-deck-pro", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Display-S3", - env: "lilygo-t-display-s3", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Display-S3 Touch", - env: "lilygo-t-display-s3-touch", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Display-S3 (SD_MMC)", - env: "lilygo-t-display-s3-mmc", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Display-S3 Touch (SD_MMC)", - env: "lilygo-t-display-s3-touch-mmc", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Display-S3 PRO", - env: "lilygo-t-display-S3-pro", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-Display (TTGO)", - env: "lilygo-t-display-ttgo", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-HMI", - env: "lilygo-t-hmi", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "Lilygo", - name: "Lilygo T-LoRa-Pager", - env: "lilygo-t-lora-pager", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "CUSTOM", - name: "Smoochiee-Board (ESP32-S3)", - env: "smoochiee-board", - family: "ESP32-S3", - partitions: { bootloader_addr: "0x0" }, - } - - { - vendor: "CUSTOM", - name: "The Phantom (Rabbit Labs)", - env: "Phantom_S024R", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "LAUNCHER", - name: "The Phantom (Rabbit Labs)", - env: "LAUNCHER_Phantom_S024R", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "CUSTOM", - name: "Marauder Mini", - env: "Marauder-Mini", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "LAUNCHER", - name: "Marauder Mini (Launcher)", - env: "LAUNCHER_Marauder-Mini", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "CUSTOM", - name: "AWOK dual Mini v2", - env: "Awok-Mini", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "CUSTOM", - name: "Marauder v7", - env: "Marauder-v7", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "LAUNCHER", - name: "Marauder v7 (Launcher)", - env: "LAUNCHER_Marauder-v7", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "CUSTOM", - name: "Marauder V4 or V6", - env: "Marauder-V4-V6", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "CUSTOM", - name: "Marauder V6.x", - env: "Marauder-v61", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "LAUNCHER", - name: "Marauder V4 or V6 (Launcher)", - env: "LAUNCHER_Marauder-V4-V6", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "LAUNCHER", - name: "Marauder V6.x (Launcher)", - env: "LAUNCHER_Marauder-v61", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } - - { - vendor: "CUSTOM", - name: "AWOK dual touch v2", - env: "Awok-Touch", - family: "ESP32", - partitions: { bootloader_addr: "0x1000" }, - } + - { env: "m5stack-cardputer", family: "ESP32-S3",} + - { env: "m5stack-cplus2", family: "ESP32",} + - { env: "m5stack-cplus1_1", family: "ESP32",} + - { env: "LAUNCHER_m5stack-cplus1_1", family: "ESP32",} + - { env: "m5stack-core2", family: "ESP32",} + - { env: "m5stack-core16mb", family: "ESP32",} + - { env: "m5stack-core4mb", family: "ESP32",} + - { env: "m5stack-cores3", family: "ESP32-S3",} + - { env: "esp32-s3-devkitc-1", family: "ESP32-S3",} + - { env: "CYD-2432S028", family: "ESP32",} + - { env: "CYD-2USB", family: "ESP32",} + - { env: "CYD-2432W328C", family: "ESP32",} + - { env: "CYD-2432W328C_2", family: "ESP32",} + - { env: "CYD-2432W328R-or-S024R", family: "ESP32",} + - { env: "LAUNCHER_CYD-2432W328R-or-S024R", family: "ESP32",} + - { env: "LAUNCHER_CYD-2432S028", family: "ESP32",} + - { env: "LAUNCHER_CYD-2USB", family: "ESP32",} + - { env: "LAUNCHER_CYD-2432W328C", family: "ESP32",} + - { env: "lilygo-t-embed-cc1101", family: "ESP32-S3",} + - { env: "lilygo-t-embed", family: "ESP32-S3",} + - { env: "lilygo-t-deck", family: "ESP32-S3",} + - { env: "lilygo-t-watch-s3", family: "ESP32-S3",} + - { env: "lilygo-t-deck-pro", family: "ESP32-S3",} + - { env: "lilygo-t-display-s3", family: "ESP32-S3",} + - { env: "lilygo-t-display-s3-touch", family: "ESP32-S3",} + - { env: "lilygo-t-display-s3-mmc", family: "ESP32-S3",} + - { env: "lilygo-t-display-s3-touch-mmc", family: "ESP32-S3",} + - { env: "lilygo-t-display-S3-pro", family: "ESP32-S3",} + - { env: "lilygo-t-display-ttgo", family: "ESP32",} + - { env: "lilygo-t-hmi", family: "ESP32-S3",} + - { env: "lilygo-t-lora-pager", family: "ESP32-S3",} + - { env: "smoochiee-board", family: "ESP32-S3",} + - { env: "Phantom_S024R", family: "ESP32",} + - { env: "LAUNCHER_Phantom_S024R", family: "ESP32",} + - { env: "Marauder-Mini", family: "ESP32",} + - { env: "LAUNCHER_Marauder-Mini", family: "ESP32",} + - { env: "Awok-Mini", family: "ESP32",} + - { env: "Marauder-v7", family: "ESP32",} + - { env: "LAUNCHER_Marauder-v7", family: "ESP32",} + - { env: "Marauder-V4-V6", family: "ESP32",} + - { env: "Marauder-v61", family: "ESP32",} + - { env: "LAUNCHER_Marauder-V4-V6", family: "ESP32",} + - { env: "LAUNCHER_Marauder-v61", family: "ESP32",} + - { env: "Awok-Touch", family: "ESP32",} + steps: - uses: actions/checkout@v4 @@ -391,19 +128,14 @@ jobs: - name: Merge files run: | - esptool.py --chip esp32s3 merge_bin -o Bruce-${{ matrix.board.env }}.bin \ - ${{ matrix.board.partitions.bootloader_addr }} .pio/build/${{ matrix.board.env }}/bootloader.bin \ - 0x8000 .pio/build/${{ matrix.board.env }}/partitions.bin \ - 0x10000 .pio/build/${{ matrix.board.env }}/firmware.bin - - # This one below isn“t working for ESP32 boards like StickCPlus2 # pio run -e ${{ matrix.board.env }} -t build-firmware + # Files are merged after build - js_content="{\"name\":\"${{ matrix.board.name }}\",\"new_install_prompt_erase\": true,\"builds\":[{\"chipFamily\":\"${{ matrix.board.family }}\",\"improv\":false,\"parts\":[{\"path\":\"Bruce-${{ matrix.board.env }}.bin\",\"offset\":0}]}]}" + js_content="{\"name\":\"${{ matrix.board.env }}\",\"new_install_prompt_erase\": true,\"builds\":[{\"chipFamily\":\"${{ matrix.board.family }}\",\"improv\":false,\"parts\":[{\"path\":\"Bruce-${{ matrix.board.env }}.bin\",\"offset\":0}]}]}" echo "$js_content" > "./Bruce-${{ matrix.board.env }}.json" - - name: Upload ${{ matrix.board.name }} + - name: Upload ${{ matrix.board.env }} uses: actions/upload-artifact@v4 with: name: Bruce-${{ matrix.board.env }} @@ -412,46 +144,130 @@ jobs: if-no-files-found: error post_compile_steps: - name: Post-compile steps + name: Update Placeholders runs-on: ubuntu-latest + environment: github_release needs: compile_sketch if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') || github.ref_type == 'tag' steps: - - uses: actions/checkout@v4 - with: - # Configura para garantir que todas as branches sejam buscadas - fetch-depth: 0 - name: Download all artifacts uses: actions/download-artifact@v4 with: - path: ~/BruceArtifacts - - name: Clone Bruce repository and switch to WebPage branch - run: | - git fetch origin - git checkout WebPage || git checkout -b WebPage origin/WebPage - - name: Move artifacts to the correct folders + pattern: '*' + merge-multiple: true + path: artifacts + + - name: Ensure releases exist and get IDs + id: get_release + uses: actions/github-script@v7 + with: + script: | + const ensureByTag = async (tag, prerelease=true) => { + try { + const { data } = await github.rest.repos.getReleaseByTag({ + owner: context.repo.owner, + repo: context.repo.repo, + tag + }); + return data.id; + } catch (e) { + if (e.status !== 404) throw e; + const { data } = await github.rest.repos.createRelease({ + owner: context.repo.owner, + repo: context.repo.repo, + tag_name: tag, + name: tag, + prerelease + }); + return data.id; + } + }; + + const betaId = await ensureByTag('betaRelease'); + const lastId = await ensureByTag('lastRelease'); + + core.setOutput('beta', String(betaId)); + core.setOutput('last', String(lastId)); + + - name: Get current sha + id: get_sha run: | - set -x - pwd - ls -all - tree - if [ "${{ github.ref_type }}" != "tag" ]; then - rm -f ./BetaRelease/* - mv -f ~/BruceArtifacts/*/*.bin ./BetaRelease - elif [ "${{ github.ref_type }}" == "tag" ]; then - rm -f ./LastRelease/* - mv -f ~/BruceArtifacts/*/*.bin ./LastRelease - fi - cp -f ~/BruceArtifacts/*/*.json ./LastRelease - cp -f ~/BruceArtifacts/*/*.json ./BetaRelease + echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT + + - name: Delete old betaRelease assets + uses: actions/github-script@v6 + with: + script: | + const release_id = ${{ steps.get_release.outputs.beta }}; + const assets = await github.rest.repos.listReleaseAssets({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: release_id + }); + for (const asset of assets.data) { + await github.rest.repos.deleteReleaseAsset({ + owner: context.repo.owner, + repo: context.repo.repo, + asset_id: asset.id + }); + } + + - name: Upload new betaRelease asset + uses: softprops/action-gh-release@v2 + with: + name: betaRelease commit (${{ steps.get_sha.outputs.GITHUB_SHA_SHORT }}) + tag_name: betaRelease + prerelease: true + files: artifacts/** + fail_on_unmatched_files: false + make_latest: false + generate_release_notes: false + + - name: Delete old lastRelease assets + uses: actions/github-script@v6 + if: github.ref_type == 'tag' + with: + script: | + const release_id = ${{ steps.get_release.outputs.last }}; + const assets = await github.rest.repos.listReleaseAssets({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: release_id + }); + for (const asset of assets.data) { + await github.rest.repos.deleteReleaseAsset({ + owner: context.repo.owner, + repo: context.repo.repo, + asset_id: asset.id + }); + } + + - name: Upload new lastRelease asset + uses: softprops/action-gh-release@v2 + if: github.ref_type == 'tag' + with: + name: lastRelease commit (${{ steps.get_sha.outputs.GITHUB_SHA_SHORT }}) + tag_name: lastRelease + prerelease: true + files: artifacts/** + fail_on_unmatched_files: false + make_latest: false + generate_release_notes: false + + - name: Checkout main to trigger WebPage deploy + if: ${{ success() }} + uses: actions/checkout@v4 + with: + ref: main + fetch-depth: 1 - - name: Commit and push changes + - name: Trigger WebPage deploy (workflow_dispatch) + if: ${{ success() }} + env: + GH_TOKEN: ${{ github.token }} run: | - git config user.name "GitHub Actions" - git config user.email "actions@github.com" - git add . - git commit -m "Update artifacts from build" - git push origin WebPage + gh workflow list + gh workflow run .github/workflows/deploy.yml --ref WebPage create_release: runs-on: ubuntu-latest diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 028568e3b..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,154 +0,0 @@ -name: Test-build - -on: - workflow_dispatch: - pull_request: - push: - branches: - - main - # - feature/cicd-adjusts - -jobs: - build_and_release: - name: Build for tests - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.x" - - - name: Cache pip - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Cache PlatformIO - uses: actions/cache@v4 - with: - path: | - ~/.platformio - key: ${{ runner.os }}-pio-${{ hashFiles('**/lockfiles') }} - restore-keys: ${{ runner.os }}-pio-${{ hashFiles('**/lockfiles') }} - - - name: Install dependencies - run: pip install requests esptool - - - name: Install PlatformIO Core - run: | - pip install platformio - platformio update - pio pkg install -p espressif32 -t toolchain-xtensa32 - - esp32_file="$HOME/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libnet80211.a" - esp32s3_file="$HOME/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/lib/libnet80211.a" - - esp32_file_temp="$HOME/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libnet80211_temp.a" - esp32s3_file_temp="$HOME/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/lib/libnet80211_temp.a" - - # Definir caminhos para as ferramentas objcopy - toolchain_esp32="$HOME/.platformio/packages/toolchain-xtensa-esp32/xtensa-esp32-elf/bin/objcopy" - toolchain_esp32s3="$HOME/.platformio/packages/toolchain-xtensa-esp32s3/xtensa-esp32s3-elf/bin/objcopy" - - # Verificar se os arquivos existem antes de executar os comandos - if [[ -f "$esp32_file" && -f "$esp32s3_file" ]]; then - # Execute objcopy commands for ESP32 - $toolchain_esp32 --weaken-symbol=ieee80211_raw_frame_sanity_check "$esp32_file" "$esp32_file_temp" - - # Rename the original file to .old - mv "$esp32_file" "${esp32_file}.old" - - # Rename the _temp to original - mv "$esp32_file_temp" "$esp32_file" - - # Execute objcopy commands for ESP32-S3 - $toolchain_esp32s3 --weaken-symbol=ieee80211_raw_frame_sanity_check "$esp32s3_file" "$esp32s3_file_temp" - - # Rename the original file to .old - mv "$esp32s3_file" "${esp32s3_file}.old" - - # Rename the _temp to original - mv "$esp32s3_file_temp" "$esp32s3_file" - - echo "Done." - else - echo "One or more specified files were not found." - exit 1 - fi - - - - name: Build Project - run: | - platformio run - - - name: Merge output binaries files - run: | - esptool.py --chip esp32 merge_bin -o .pio/build/m5stack-cplus1_1/release.bin --flash_mode dio --flash_size 4MB 0x1000 .pio/build/m5stack-cplus1_1/bootloader.bin 0x8000 .pio/build/m5stack-cplus1_1/partitions.bin 0x10000 .pio/build/m5stack-cplus1_1/firmware.bin - esptool.py --chip esp32 merge_bin -o .pio/build/m5stack-cplus2/release.bin --flash_mode dio --flash_size 8MB 0x1000 .pio/build/m5stack-cplus2/bootloader.bin 0x8000 .pio/build/m5stack-cplus2/partitions.bin 0x10000 .pio/build/m5stack-cplus2/firmware.bin - esptool.py --chip esp32s3 merge_bin -o .pio/build/m5stack-cardputer/release.bin --flash_mode dio --flash_size 8MB 0x0000 .pio/build/m5stack-cardputer/bootloader.bin 0x8000 .pio/build/m5stack-cardputer/partitions.bin 0x10000 .pio/build/m5stack-cardputer/firmware.bin - - - name: Rename release.bin files - run: | - for file in $(find .pio/build/**/ -name 'release.bin'); do - version=$(echo ${{ github.run_number }}) - env=$(basename $(dirname "$file")) - new_name="Bruce_${env}_v0.0.$version.bin" - mv "$file" "$(dirname "$file")/$new_name" - done - chmod +r .pio/build/**/Bruce*.bin - ls .pio/build/**/Bruce*.bin - if: github.event_name != 'pull_request' - - - name: Upload Binaries - id: upload_binaries_Cplus - uses: actions/upload-artifact@v4 - with: - path: .pio/build/m5stack-cplus1_1/Bruce*.bin - if: github.event_name != 'pull_request' - - - name: Upload Binaries - id: upload_binaries_Cplus2 - uses: actions/upload-artifact@v4 - with: - path: .pio/build/m5stack-cplus2/Bruce*.bin - if: github.event_name != 'pull_request' - - - name: Upload Binaries_Card - id: upload_binaries - uses: actions/upload-artifact@v4 - with: - path: .pio/build/m5stack-cardputer/Bruce*.bin - if: github.event_name != 'pull_request' - - #- name: Create Release - # id: create_release - # uses: actions/create-release@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.RELEASES_TOKEN }} - # with: - # tag_name: v0.0.${{ github.run_number }} - # release_name: v0.0.${{ github.run_number }} - # draft: true - # prerelease: false - # body: | - # Release automatically generated by CI/CD workflow. - # if: github.event_name != 'pull_request' - - #- name: Upload Binaries Release Assets - # run: | - # for file in $(find .pio/build/** -name 'ESP_Web2Sd-Mgr*.bin'); do - # echo "Uploading $file" - # curl \ - # -X POST \ - # --data-binary @"$file" \ - # -H "Authorization: Bearer ${{ secrets.RELEASES_TOKEN }}" \ - # -H "Content-Type: application/octet-stream" \ - # "${{ steps.create_release.outputs.upload_url }}=$(basename $file)" - # done diff --git a/build.py b/build.py index cf937e857..3f536ea35 100644 --- a/build.py +++ b/build.py @@ -1,29 +1,103 @@ -from typing import TYPE_CHECKING, Any - -if TYPE_CHECKING: - Import: Any = None - env: Any = {} +from pathlib import Path +from SCons.Script import Import +# Import PlatformIO's SCons environment Import("env") +senv = env # avoid shadowing with the action's 'env' parameter + +# Optional: keep your extra flag +senv.Append(CXXFLAGS=["-Wno-conversion-null"]) + +# ---- Detect MCU and map bootloader offsets ---- +board_config = senv.BoardConfig() +mcu = (board_config.get("build.mcu") or senv.get("BOARD_MCU") or "").lower() + +BOOT_OFFSETS = { + "esp32": 0x1000, # ESP32 + "esp32s3": 0x0000, # ESP32-S3 + "esp32c5": 0x2000, # ESP32-C5 +} +boot_offset = BOOT_OFFSETS.get(mcu, 0x0000) # safe fallback + +# Default offsets (adjust if your partitions.csv uses custom addresses) +PART_TABLE_OFFSET = 0x8000 +APP_OFFSET = 0x10000 + +# Paths +build_dir = Path(senv.subst("$BUILD_DIR")) +proj_dir = Path(senv.subst("$PROJECT_DIR")) +pioenv = senv.subst("${PIOENV}") + +boot_bin = build_dir / "bootloader.bin" +part_bin = build_dir / "partitions.bin" +app_bin = build_dir / "firmware.bin" + +out_bin = proj_dir / f"Bruce-{pioenv}.bin" + +# Esptool from PlatformIO + Python executable +esptool_pkg = senv.PioPlatform().get_package_dir("tool-esptoolpy") +esptool_py = str(Path(esptool_pkg) / "esptool") +python_exe = senv.get("PYTHONEXE", "python") + +chip_arg = mcu if mcu else "esp32" + +def _merge_bins_callback(target, source, env): + """ + Post-action callback executed after firmware.bin is built. + Merges bootloader, partitions, and app into a single binary. + NOTE: This function signature must be (target, source, env) so SCons can call it. + """ + # Check files + missing = [p for p in [boot_bin, part_bin, app_bin] if not p.exists()] + if missing: + print("[merge_bin] Missing files, merge aborted:") + for p in missing: + print(f" - {p}") + return + + # Quote paths for Windows safety + def q(p): return f"\"{p}\"" + + cmd = " ".join([ + "pio pkg exec -p \"tool-esptoolpy\" -- esptool.py", + "--chip", chip_arg, + "merge_bin", + "--output", q(out_bin), + hex(boot_offset), q(boot_bin), + hex(PART_TABLE_OFFSET), q(part_bin), + hex(APP_OFFSET), q(app_bin), + ]) + + print("[merge_bin] Merging binaries:") + print(" ", cmd) + rc = env.Execute(cmd) + if rc != 0: + print(f"[merge_bin] Failed with exit code {rc}") + else: + try: + size = out_bin.stat().st_size + except FileNotFoundError: + size = 0 + print(f"[merge_bin] Success -> {out_bin} ({size} bytes)") + +# Automatically run after firmware.bin is generated +senv.AddPostAction(str(app_bin), _merge_bins_callback) -env.Append(CXXFLAGS=["-Wno-conversion-null"]) -env.AddCustomTarget( - "build-firmware", - [ - "$BUILD_DIR/bootloader.bin", - "$BUILD_DIR/partitions.bin", - "$BUILD_DIR/firmware.bin", - ], - 'pio pkg exec -p "tool-esptoolpy" -- esptool.py --chip ${BOARD_MCU} merge_bin --output Bruce-${PIOENV}.bin 0x0 ${BUILD_DIR}/bootloader.bin 0x8000 ${BUILD_DIR}/partitions.bin 0x10000 ${BUILD_DIR}/firmware.bin', - "Build Firmware", +# Optional manual target: depend on the three binaries and run the same callback +# Wrap it in a lambda so SCons can call it without (target, source, env) if needed. +senv.AddCustomTarget( + name="build-firmware", + dependencies=[str(boot_bin), str(part_bin), str(app_bin)], + actions=[_merge_bins_callback], + title="Build Firmware (merge)", + description="Merge bootloader + partitions + app into a single .bin file" ) -env.AddCustomTarget( +# Keep your upload-nobuild helper +senv.AddCustomTarget( name="upload-nobuild", dependencies=None, - actions=[ - "platformio run -t upload -t nobuild -e ${PIOENV}", - ], + actions=[f"platformio run -t upload -t nobuild -e {pioenv}"], title="Upload Nobuild", - description="Runs pio upload without building new firmware", + description="Run upload without rebuilding" ) diff --git a/patch.py b/patch.py index c9d06afd0..062baacad 100644 --- a/patch.py +++ b/patch.py @@ -14,12 +14,12 @@ Import("env") # type: ignore FRAMEWORK_DIR = env.PioPlatform().get_package_dir("framework-arduinoespressif32") -patchflag_path = join(FRAMEWORK_DIR, ".patched") board_mcu = env.BoardConfig() mcu = board_mcu.get("build.mcu", "") +patchflag_path = join(FRAMEWORK_DIR, "tools", "sdk", mcu, "lib", ".patched") # patch file only if we didn't do it befored -if not isfile(join(FRAMEWORK_DIR, ".patched")): +if not isfile(patchflag_path): original_file = join(FRAMEWORK_DIR, "tools", "sdk", mcu, "lib", "libnet80211.a") patched_file = join( FRAMEWORK_DIR, "tools", "sdk", mcu, "lib", "libnet80211.a.patched" diff --git a/platformio.ini b/platformio.ini index 8000d4d4f..0fed322a5 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,19 +10,50 @@ [platformio] default_envs = - ;m5stack-cplus1_1 - ;m5stack-cplus2 ;m5stack-cardputer + ;m5stack-cplus2 + ;m5stack-cplus1_1 + ;LAUNCHER_m5stack-cplus1_1 ;m5stack-core2 ;m5stack-core16mb ;m5stack-core4mb ;m5stack-cores3 + ;esp32-s3-devkitc-1 ;CYD-2432S028 ;CYD-2USB + ;CYD-2432W328C + ;CYD-2432W328C_2 + ;CYD-2432W328R-or-S024R + ;LAUNCHER_CYD-2432W328R-or-S024R + ;LAUNCHER_CYD-2432S028 + ;LAUNCHER_CYD-2USB + ;LAUNCHER_CYD-2432W328C lilygo-t-embed-cc1101 + ;lilygo-t-embed ;lilygo-t-deck + ;lilygo-t-watch-s3 + ;lilygo-t-deck-pro ;lilygo-t-display-s3 + ;lilygo-t-display-s3-touch + ;lilygo-t-display-s3-mmc + ;lilygo-t-display-s3-touch-mmc + ;lilygo-t-display-S3-pro + ;lilygo-t-display-ttgo + ;lilygo-t-hmi ;lilygo-t-lora-pager + ;smoochiee-board + ;Phantom_S024R + ;LAUNCHER_Phantom_S024R + ;Marauder-Mini + ;LAUNCHER_Marauder-Mini + ;Awok-Mini + ;Marauder-v7 + ;LAUNCHER_Marauder-v7 + ;Marauder-V4-V6 + ;Marauder-v61 + ;LAUNCHER_Marauder-V4-V6 + ;LAUNCHER_Marauder-v61 + ;Awok-Touch" ;uncomment to not use global dirs to avoid possible conflicts ;platforms_dir = .pio/platforms ;packages_dir = .pio/packages diff --git a/src/core/display.cpp b/src/core/display.cpp index cff6de011..9bfb5368a 100644 --- a/src/core/display.cpp +++ b/src/core/display.cpp @@ -1226,7 +1226,7 @@ bool showJpeg(FS &fs, String filename, int x, int y, bool center) { delete[] data_array; // free heap before leaving return true; } - +#if !defined(LITE_VERSION) // #################################################################################################### // Draw a GIF on the TFT // derived from @@ -1423,7 +1423,7 @@ bool showGif(FS *fs, const char *filename, int x, int y, bool center, int playDu return true; } - +#endif /*************************************************************************************** ** Function name: getComplementaryColor2 ** Description: Get simple complementary color in RGB565 format @@ -1625,7 +1625,9 @@ bool drawImg(FS &fs, String filename, int x, int y, bool center, int playDuratio if (ext.endsWith("jpg")) return showJpeg(fs, filename, x, y, center); else if (ext.endsWith("bmp")) return drawBmp(fs, filename, x, y, center); else if (ext.endsWith("png")) return drawPNG(fs, filename, x, y, center); +#if !defined(LITE_VERSION) else if (ext.endsWith("gif")) return showGif(&fs, filename.c_str(), x, y, center, playDurationMs); +#endif else log_e("Image not supported"); return false; diff --git a/src/core/display.h b/src/core/display.h index 27d1456b3..516c7d3e1 100644 --- a/src/core/display.h +++ b/src/core/display.h @@ -25,7 +25,7 @@ struct Opt_Coord { uint16_t bgcolor = bruceConfig.bgColor; }; void displayScrollingText(const String &text, Opt_Coord &coord); - +#if !defined(LITE_VERSION) #include struct GifPosition { @@ -79,6 +79,7 @@ class Gif { static void GIFDraw(GIFDRAW *pDraw); }; +#endif /* * @name drawImg * @param fs: File system @@ -91,7 +92,9 @@ class Gif { bool drawImg(FS &fs, String filename, int x = 0, int y = 0, bool center = false, int playDurationMs = 0); bool drawPNG(FS &fs, String filename, int x, int y, bool center); bool drawBmp(FS &fs, String filename, int x = 0, int y = 0, bool center = false); +#if !defined(LITE_VERSION) bool showGif(FS *fs, const char *filename, int x = 0, int y = 0, bool center = false, int playDurationMs = 0); +#endif bool showJpeg(FS &fs, String filename, int x = 0, int y = 0, bool center = false); uint16_t getComplementaryColor(uint16_t color); @@ -162,7 +165,8 @@ inline int loopOptions(std::vector