diff --git a/.github/workflows/build_esp32.yml b/.github/workflows/build_esp32.yml deleted file mode 100644 index 2c4622f43..000000000 --- a/.github/workflows/build_esp32.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build ESP32 - -on: - workflow_call: - inputs: - version: - required: true - type: string - board: - required: true - type: string - -permissions: read-all - -jobs: - build-esp32: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Build ESP32 - id: build - uses: meshtastic/gh-action-firmware@main - with: - pio_platform: esp32 - pio_env: ${{ inputs.board }} - pio_target: build - ota_firmware_source: firmware.bin - ota_firmware_target: release/bleota.bin - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-esp32-${{ inputs.board }}-${{ inputs.version }}.zip - overwrite: true - path: | - release/*.bin - release/*.elf diff --git a/.github/workflows/build_esp32_c3.yml b/.github/workflows/build_esp32_c3.yml deleted file mode 100644 index 3e7746166..000000000 --- a/.github/workflows/build_esp32_c3.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build ESP32-C3 - -on: - workflow_call: - inputs: - version: - required: true - type: string - board: - required: true - type: string - -permissions: read-all - -jobs: - build-esp32-c3: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Build ESP32-C3 - id: build - uses: meshtastic/gh-action-firmware@main - with: - pio_platform: esp32 - pio_env: ${{ inputs.board }} - pio_target: build - ota_firmware_source: firmware-c3.bin - ota_firmware_target: release/bleota-c3.bin - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-esp32c3-${{ inputs.board }}-${{ inputs.version }}.zip - overwrite: true - path: | - release/*.bin - release/*.elf diff --git a/.github/workflows/build_esp32_c6.yml b/.github/workflows/build_esp32_c6.yml deleted file mode 100644 index 6f32eb3c6..000000000 --- a/.github/workflows/build_esp32_c6.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build ESP32-C6 - -on: - workflow_call: - inputs: - version: - required: true - type: string - board: - required: true - type: string - -permissions: read-all - -jobs: - build-esp32-c6: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Build ESP32-C6 - id: build - uses: meshtastic/gh-action-firmware@main - with: - pio_platform: esp32 - pio_env: ${{ inputs.board }} - pio_target: build - ota_firmware_source: firmware-c3.bin - ota_firmware_target: release/bleota-c3.bin - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-esp32c6-${{ inputs.board }}-${{ inputs.version }}.zip - overwrite: true - path: | - release/*.bin - release/*.elf diff --git a/.github/workflows/build_esp32_s3.yml b/.github/workflows/build_esp32_s3.yml deleted file mode 100644 index 6527d6d7c..000000000 --- a/.github/workflows/build_esp32_s3.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build ESP32-S3 - -on: - workflow_call: - inputs: - version: - required: true - type: string - board: - required: true - type: string - -permissions: read-all - -jobs: - build-esp32-s3: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Build ESP32-S3 - id: build - uses: meshtastic/gh-action-firmware@main - with: - pio_platform: esp32 - pio_env: ${{ inputs.board }} - pio_target: build - ota_firmware_source: firmware-s3.bin - ota_firmware_target: release/bleota-s3.bin - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-esp32s3-${{ inputs.board }}-${{ inputs.version }}.zip - overwrite: true - path: | - release/*.bin - release/*.elf diff --git a/.github/workflows/build_firmware.yml b/.github/workflows/build_firmware.yml new file mode 100644 index 000000000..df1035e62 --- /dev/null +++ b/.github/workflows/build_firmware.yml @@ -0,0 +1,66 @@ +name: Build + +on: + workflow_call: + inputs: + version: + required: true + type: string + platform: + required: true + type: string + pio_env: + required: true + type: string + +permissions: read-all + +jobs: + pio-build: + name: build-${{ inputs.platform }} + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + + - name: Set OTA firmware source and target + if: startsWith(inputs.platform, 'esp32') + id: ota_dir + env: + PIO_PLATFORM: ${{ inputs.platform }} + run: | + if [ "$PIO_PLATFORM" = "esp32s3" ]; then + echo "src=firmware-s3.bin" >> $GITHUB_OUTPUT + echo "tgt=release/bleota-s3.bin" >> $GITHUB_OUTPUT + elif [ "$PIO_PLATFORM" = "esp32c3" ] || [ "$PIO_PLATFORM" = "esp32c6" ]; then + echo "src=firmware-c3.bin" >> $GITHUB_OUTPUT + echo "tgt=release/bleota-c3.bin" >> $GITHUB_OUTPUT + elif [ "$PIO_PLATFORM" = "esp32" ]; then + echo "src=firmware.bin" >> $GITHUB_OUTPUT + echo "tgt=release/bleota.bin" >> $GITHUB_OUTPUT + fi + + - name: Build ${{ inputs.platform }} + id: build + uses: meshtastic/gh-action-firmware@main + with: + pio_platform: ${{ inputs.platform }} + pio_env: ${{ inputs.pio_env }} + pio_target: build + ota_firmware_source: ${{ steps.ota_dir.outputs.src || '' }} + ota_firmware_target: ${{ steps.ota_dir.outputs.tgt || '' }} + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-${{ inputs.platform }}-${{ inputs.pio_env }}-${{ inputs.version }}.zip + overwrite: true + path: | + release/*.bin + release/*.elf + release/*.uf2 + release/*.hex + release/*-ota.zip diff --git a/.github/workflows/build_nrf52.yml b/.github/workflows/build_nrf52.yml deleted file mode 100644 index 89be40187..000000000 --- a/.github/workflows/build_nrf52.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build NRF52 - -on: - workflow_call: - inputs: - version: - required: true - type: string - board: - required: true - type: string - -permissions: read-all - -jobs: - build-nrf52: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Build NRF52 - id: build - uses: meshtastic/gh-action-firmware@main - with: - pio_platform: nrf52 - pio_env: ${{ inputs.board }} - pio_target: build - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-nrf52840-${{ inputs.board }}-${{ inputs.version }}.zip - overwrite: true - path: | - release/*.uf2 - release/*.elf - release/*.hex - release/*-ota.zip diff --git a/.github/workflows/build_rpi2040.yml b/.github/workflows/build_rpi2040.yml deleted file mode 100644 index fbaa21684..000000000 --- a/.github/workflows/build_rpi2040.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Build RPI2040 - -on: - workflow_call: - inputs: - version: - required: true - type: string - board: - required: true - type: string - -permissions: read-all - -jobs: - build-rpi2040: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Build Raspberry Pi 2040 - id: build - uses: meshtastic/gh-action-firmware@main - with: - pio_platform: rp2xx0 - pio_env: ${{ inputs.board }} - pio_target: build - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-rp2040-${{ inputs.board }}-${{ inputs.version }}.zip - overwrite: true - path: | - release/*.uf2 - release/*.elf diff --git a/.github/workflows/build_stm32.yml b/.github/workflows/build_stm32.yml deleted file mode 100644 index f06e8f3b8..000000000 --- a/.github/workflows/build_stm32.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Build STM32 - -on: - workflow_call: - inputs: - version: - required: true - type: string - board: - required: true - type: string - -permissions: read-all - -jobs: - build-stm32: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - ref: ${{github.event.pull_request.head.ref}} - repository: ${{github.event.pull_request.head.repo.full_name}} - - - name: Build STM32WL - id: build - uses: meshtastic/gh-action-firmware@main - with: - pio_platform: stm32wl - pio_env: ${{ inputs.board }} - pio_target: build - - - name: Store binaries as an artifact - uses: actions/upload-artifact@v4 - with: - name: firmware-stm32-${{ inputs.board }}-${{ inputs.version }}.zip - overwrite: true - path: | - release/*.hex - release/*.bin - release/*.elf diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index a3e8caf15..0760c0491 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -95,70 +95,77 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32) }} - uses: ./.github/workflows/build_esp32.yml + uses: ./.github/workflows/build_firmware.yml with: version: ${{ needs.version.outputs.long }} - board: ${{ matrix.board }} + pio_env: ${{ matrix.board }} + platform: esp32 - build-esp32-s3: + build-esp32s3: needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32s3) }} - uses: ./.github/workflows/build_esp32_s3.yml + uses: ./.github/workflows/build_firmware.yml with: version: ${{ needs.version.outputs.long }} - board: ${{ matrix.board }} + pio_env: ${{ matrix.board }} + platform: esp32s3 - build-esp32-c3: + build-esp32c3: needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32c3) }} - uses: ./.github/workflows/build_esp32_c3.yml + uses: ./.github/workflows/build_firmware.yml with: version: ${{ needs.version.outputs.long }} - board: ${{ matrix.board }} + pio_env: ${{ matrix.board }} + platform: esp32c3 - build-esp32-c6: + build-esp32c6: needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32c6) }} - uses: ./.github/workflows/build_esp32_c6.yml + uses: ./.github/workflows/build_firmware.yml with: version: ${{ needs.version.outputs.long }} - board: ${{ matrix.board }} + pio_env: ${{ matrix.board }} + platform: esp32c6 - build-nrf52: + build-nrf52840: needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.nrf52840) }} - uses: ./.github/workflows/build_nrf52.yml + uses: ./.github/workflows/build_firmware.yml with: version: ${{ needs.version.outputs.long }} - board: ${{ matrix.board }} + pio_env: ${{ matrix.board }} + platform: nrf52840 build-rpi2040: needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.rp2040) }} - uses: ./.github/workflows/build_rpi2040.yml + uses: ./.github/workflows/build_firmware.yml with: version: ${{ needs.version.outputs.long }} - board: ${{ matrix.board }} + pio_env: ${{ matrix.board }} + platform: rp2040 build-stm32: needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.stm32) }} - uses: ./.github/workflows/build_stm32.yml + uses: ./.github/workflows/build_firmware.yml with: version: ${{ needs.version.outputs.long }} - board: ${{ matrix.board }} + pio_env: ${{ matrix.board }} + platform: stm32 build-debian-src: if: github.repository == 'meshtastic/firmware' @@ -242,10 +249,10 @@ jobs: [ version, build-esp32, - build-esp32-s3, - build-esp32-c3, - build-esp32-c6, - build-nrf52, + build-esp32s3, + build-esp32c3, + build-esp32c6, + build-nrf52840, build-rpi2040, build-stm32, ]