diff --git a/.github/workflows/build_esp32.yml b/.github/workflows/build_esp32.yml index 32cd45000..2c4622f43 100644 --- a/.github/workflows/build_esp32.yml +++ b/.github/workflows/build_esp32.yml @@ -3,6 +3,9 @@ name: Build ESP32 on: workflow_call: inputs: + version: + required: true + type: string board: required: true type: string @@ -14,11 +17,10 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version + with: + submodules: recursive + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - name: Build ESP32 id: build @@ -33,7 +35,7 @@ jobs: - name: Store binaries as an artifact uses: actions/upload-artifact@v4 with: - name: firmware-esp32-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + name: firmware-esp32-${{ inputs.board }}-${{ inputs.version }}.zip overwrite: true path: | release/*.bin diff --git a/.github/workflows/build_esp32_c3.yml b/.github/workflows/build_esp32_c3.yml index 161786f99..3e7746166 100644 --- a/.github/workflows/build_esp32_c3.yml +++ b/.github/workflows/build_esp32_c3.yml @@ -3,6 +3,9 @@ name: Build ESP32-C3 on: workflow_call: inputs: + version: + required: true + type: string board: required: true type: string @@ -14,11 +17,10 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version + 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 @@ -33,7 +35,7 @@ jobs: - name: Store binaries as an artifact uses: actions/upload-artifact@v4 with: - name: firmware-esp32c3-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + name: firmware-esp32c3-${{ inputs.board }}-${{ inputs.version }}.zip overwrite: true path: | release/*.bin diff --git a/.github/workflows/build_esp32_c6.yml b/.github/workflows/build_esp32_c6.yml index 90cdcc78e..6f32eb3c6 100644 --- a/.github/workflows/build_esp32_c6.yml +++ b/.github/workflows/build_esp32_c6.yml @@ -3,6 +3,9 @@ name: Build ESP32-C6 on: workflow_call: inputs: + version: + required: true + type: string board: required: true type: string @@ -14,11 +17,10 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version + 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 @@ -33,7 +35,7 @@ jobs: - name: Store binaries as an artifact uses: actions/upload-artifact@v4 with: - name: firmware-esp32c6-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + name: firmware-esp32c6-${{ inputs.board }}-${{ inputs.version }}.zip overwrite: true path: | release/*.bin diff --git a/.github/workflows/build_esp32_s3.yml b/.github/workflows/build_esp32_s3.yml index e5ed48e3e..6527d6d7c 100644 --- a/.github/workflows/build_esp32_s3.yml +++ b/.github/workflows/build_esp32_s3.yml @@ -3,6 +3,9 @@ name: Build ESP32-S3 on: workflow_call: inputs: + version: + required: true + type: string board: required: true type: string @@ -14,11 +17,10 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version + 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 @@ -33,7 +35,7 @@ jobs: - name: Store binaries as an artifact uses: actions/upload-artifact@v4 with: - name: firmware-esp32s3-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + name: firmware-esp32s3-${{ inputs.board }}-${{ inputs.version }}.zip overwrite: true path: | release/*.bin diff --git a/.github/workflows/build_nrf52.yml b/.github/workflows/build_nrf52.yml index 312aeb372..89be40187 100644 --- a/.github/workflows/build_nrf52.yml +++ b/.github/workflows/build_nrf52.yml @@ -3,6 +3,9 @@ name: Build NRF52 on: workflow_call: inputs: + version: + required: true + type: string board: required: true type: string @@ -14,11 +17,10 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version + with: + submodules: recursive + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - name: Build NRF52 id: build @@ -31,7 +33,7 @@ jobs: - name: Store binaries as an artifact uses: actions/upload-artifact@v4 with: - name: firmware-nrf52840-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + name: firmware-nrf52840-${{ inputs.board }}-${{ inputs.version }}.zip overwrite: true path: | release/*.uf2 diff --git a/.github/workflows/build_rpi2040.yml b/.github/workflows/build_rpi2040.yml index 2abd7a839..fbaa21684 100644 --- a/.github/workflows/build_rpi2040.yml +++ b/.github/workflows/build_rpi2040.yml @@ -3,6 +3,9 @@ name: Build RPI2040 on: workflow_call: inputs: + version: + required: true + type: string board: required: true type: string @@ -14,11 +17,10 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version + 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 @@ -31,7 +33,7 @@ jobs: - name: Store binaries as an artifact uses: actions/upload-artifact@v4 with: - name: firmware-rp2040-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + name: firmware-rp2040-${{ inputs.board }}-${{ inputs.version }}.zip overwrite: true path: | release/*.uf2 diff --git a/.github/workflows/build_stm32.yml b/.github/workflows/build_stm32.yml index 10680f422..f06e8f3b8 100644 --- a/.github/workflows/build_stm32.yml +++ b/.github/workflows/build_stm32.yml @@ -3,6 +3,9 @@ name: Build STM32 on: workflow_call: inputs: + version: + required: true + type: string board: required: true type: string @@ -14,11 +17,10 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - - name: Get release version string - shell: bash - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version + with: + submodules: recursive + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - name: Build STM32WL id: build @@ -31,7 +33,7 @@ jobs: - name: Store binaries as an artifact uses: actions/upload-artifact@v4 with: - name: firmware-stm32-${{ inputs.board }}-${{ steps.version.outputs.long }}.zip + name: firmware-stm32-${{ inputs.board }}-${{ inputs.version }}.zip overwrite: true path: | release/*.hex diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index a676efa1e..9d5cb0981 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -33,9 +33,7 @@ jobs: arch: [esp32, esp32s3, esp32c3, esp32c6, nrf52840, rp2040, stm32, check] runs-on: ubuntu-latest steps: - - id: checkout - uses: actions/checkout@v4 - name: Checkout base + - uses: actions/checkout@v4 - id: jsonStep run: | if [[ "$GITHUB_HEAD_REF" == "" ]]; then @@ -55,6 +53,21 @@ jobs: stm32: ${{ steps.jsonStep.outputs.stm32 }} check: ${{ steps.jsonStep.outputs.check }} + version: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Get release version string + run: | + echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT + id: version + env: + BUILD_LOCATION: local + outputs: + long: ${{ steps.version.outputs.long }} + deb: ${{ steps.version.outputs.deb }} + check: needs: setup strategy: @@ -72,66 +85,73 @@ jobs: run: bin/check-all.sh ${{ matrix.board }} build-esp32: - needs: setup + needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32) }} uses: ./.github/workflows/build_esp32.yml with: + version: ${{ needs.version.outputs.long }} board: ${{ matrix.board }} build-esp32-s3: - needs: setup + needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32s3) }} uses: ./.github/workflows/build_esp32_s3.yml with: + version: ${{ needs.version.outputs.long }} board: ${{ matrix.board }} build-esp32-c3: - needs: setup + needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32c3) }} uses: ./.github/workflows/build_esp32_c3.yml with: + version: ${{ needs.version.outputs.long }} board: ${{ matrix.board }} build-esp32-c6: - needs: setup + needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.esp32c6) }} uses: ./.github/workflows/build_esp32_c6.yml with: + version: ${{ needs.version.outputs.long }} board: ${{ matrix.board }} build-nrf52: - needs: setup + needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.nrf52840) }} uses: ./.github/workflows/build_nrf52.yml with: + version: ${{ needs.version.outputs.long }} board: ${{ matrix.board }} build-rpi2040: - needs: setup + needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.rp2040) }} uses: ./.github/workflows/build_rpi2040.yml with: + version: ${{ needs.version.outputs.long }} board: ${{ matrix.board }} build-stm32: - needs: setup + needs: [setup, version] strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.stm32) }} uses: ./.github/workflows/build_stm32.yml with: + version: ${{ needs.version.outputs.long }} board: ${{ matrix.board }} build-debian-src: @@ -214,6 +234,7 @@ jobs: runs-on: ubuntu-latest needs: [ + version, build-esp32, build-esp32-s3, build-esp32-c3, @@ -238,17 +259,13 @@ jobs: - name: Display structure of downloaded files run: ls -R - - name: Get release version string - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - name: Move files up run: mv -b -t ./ ./bin/device-*.sh ./bin/device-*.bat - name: Repackage in single firmware zip uses: actions/upload-artifact@v4 with: - name: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }} + name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }} overwrite: true path: | ./firmware-*.bin @@ -264,7 +281,7 @@ jobs: - uses: actions/download-artifact@v4 with: - name: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }} + name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }} merge-multiple: true path: ./output @@ -278,12 +295,12 @@ jobs: chmod +x ./output/device-update.sh - name: Zip firmware - run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip ./output + run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./output - name: Repackage in single elfs zip uses: actions/upload-artifact@v4 with: - name: debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip + name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip overwrite: true path: ./*.elf retention-days: 30 @@ -291,8 +308,8 @@ jobs: - uses: scruplelesswizard/comment-artifact@main if: ${{ github.event_name == 'pull_request' }} with: - name: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }} - description: "Download firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip. This artifact will be available for 90 days from creation" + name: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }} + description: "Download firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip. This artifact will be available for 90 days from creation" github-token: ${{ secrets.GITHUB_TOKEN }} release-artifacts: @@ -301,6 +318,7 @@ jobs: outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} needs: + - version - gather-artifacts - build-debian-src - package-pio-deps-native-tft @@ -313,44 +331,36 @@ jobs: with: python-version: 3.x - - name: Get release version string - run: | - echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - echo "deb=$(./bin/buildinfo.py deb)" >> $GITHUB_OUTPUT - id: version - env: - BUILD_LOCATION: local - - name: Create release uses: softprops/action-gh-release@v2 id: create_release with: draft: true prerelease: true - name: Meshtastic Firmware ${{ steps.version.outputs.long }} Alpha - tag_name: v${{ steps.version.outputs.long }} + name: Meshtastic Firmware ${{ needs.version.outputs.long }} Alpha + tag_name: v${{ needs.version.outputs.long }} body: | Autogenerated by github action, developer should edit as required before publishing... - name: Download source deb uses: actions/download-artifact@v4 with: - pattern: firmware-debian-${{ steps.version.outputs.deb }}~UNRELEASED-src + pattern: firmware-debian-${{ needs.version.outputs.deb }}~UNRELEASED-src merge-multiple: true path: ./output/debian-src - name: Download `native-tft` pio deps uses: actions/download-artifact@v4 with: - pattern: platformio-deps-native-tft-${{ steps.version.outputs.long }} + pattern: platformio-deps-native-tft-${{ needs.version.outputs.long }} merge-multiple: true path: ./output/pio-deps-native-tft - name: Zip Linux sources working-directory: output run: | - zip -j -9 -r ./meshtasticd-${{ steps.version.outputs.deb }}-src.zip ./debian-src - zip -9 -r ./platformio-deps-native-tft-${{ steps.version.outputs.long }}.zip ./pio-deps-native-tft + zip -j -9 -r ./meshtasticd-${{ needs.version.outputs.deb }}-src.zip ./debian-src + zip -9 -r ./platformio-deps-native-tft-${{ needs.version.outputs.long }}.zip ./pio-deps-native-tft # For diagnostics - name: Display structure of downloaded files @@ -360,8 +370,8 @@ jobs: # Only run when targeting master branch with workflow_dispatch if: ${{ github.ref_name == 'master' }} run: | - gh release upload v${{ steps.version.outputs.long }} ./output/meshtasticd-${{ steps.version.outputs.deb }}-src.zip - gh release upload v${{ steps.version.outputs.long }} ./output/platformio-deps-native-tft-${{ steps.version.outputs.long }}.zip + gh release upload v${{ needs.version.outputs.long }} ./output/meshtasticd-${{ needs.version.outputs.deb }}-src.zip + gh release upload v${{ needs.version.outputs.long }} ./output/platformio-deps-native-tft-${{ needs.version.outputs.long }}.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -372,7 +382,7 @@ jobs: arch: [esp32, esp32s3, esp32c3, esp32c6, nrf52840, rp2040, stm32] runs-on: ubuntu-latest if: ${{ github.event_name == 'workflow_dispatch' }} - needs: [release-artifacts] + needs: [release-artifacts, version] steps: - name: Checkout uses: actions/checkout@v4 @@ -382,13 +392,9 @@ jobs: with: python-version: 3.x - - name: Get release version string - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - uses: actions/download-artifact@v4 with: - pattern: firmware-${{matrix.arch}}-${{ steps.version.outputs.long }} + pattern: firmware-${{matrix.arch}}-${{ needs.version.outputs.long }} merge-multiple: true path: ./output @@ -401,16 +407,16 @@ jobs: chmod +x ./output/device-update.sh - name: Zip firmware - run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip ./output + run: zip -j -9 -r ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./output - uses: actions/download-artifact@v4 with: - name: debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip + name: debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip merge-multiple: true path: ./elfs - name: Zip debug elfs - run: zip -j -9 -r ./debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip ./elfs + run: zip -j -9 -r ./debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip ./elfs # For diagnostics - name: Display structure of downloaded files @@ -420,15 +426,15 @@ jobs: # Only run when targeting master branch with workflow_dispatch if: ${{ github.ref_name == 'master' }} run: | - gh release upload v${{ steps.version.outputs.long }} ./firmware-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip - gh release upload v${{ steps.version.outputs.long }} ./debug-elfs-${{matrix.arch}}-${{ steps.version.outputs.long }}.zip + gh release upload v${{ needs.version.outputs.long }} ./firmware-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip + gh release upload v${{ needs.version.outputs.long }} ./debug-elfs-${{matrix.arch}}-${{ needs.version.outputs.long }}.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} publish-firmware: runs-on: ubuntu-24.04 if: ${{ github.event_name == 'workflow_dispatch' }} - needs: [release-firmware] + needs: [release-firmware, version] env: targets: esp32,esp32s3,esp32c3,esp32c6,nrf52840,rp2040,stm32 steps: @@ -440,13 +446,9 @@ jobs: with: python-version: 3.x - - name: Get release version string - run: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT - id: version - - uses: actions/download-artifact@v4 with: - pattern: firmware-{${{ env.targets }}}-${{ steps.version.outputs.long }} + pattern: firmware-{${{ env.targets }}}-${{ needs.version.outputs.long }} merge-multiple: true path: ./publish @@ -460,9 +462,9 @@ jobs: external_repository: meshtastic/meshtastic.github.io publish_branch: master publish_dir: ./publish - destination_dir: ${{ env.DEST_PREFIX }}firmware-${{ steps.version.outputs.long }} + destination_dir: ${{ env.DEST_PREFIX }}firmware-${{ needs.version.outputs.long }} keep_files: true user_name: github-actions[bot] user_email: github-actions[bot]@users.noreply.github.com - commit_message: ${{ steps.version.outputs.long }} + commit_message: ${{ needs.version.outputs.long }} enable_jekyll: true