|
| 1 | +name: Firmware Matrix Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + generate-matrix: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + outputs: |
| 12 | + matrix: ${{ steps.set-matrix.outputs.matrix }} |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v6 |
| 15 | + with: |
| 16 | + submodules: true |
| 17 | + |
| 18 | + - name: Set matrix |
| 19 | + id: set-matrix |
| 20 | + run: | |
| 21 | + export EVENT_NAME="${{github.event_name}}" |
| 22 | + export RUN_ATTEMPT="${{github.run_attempt}}" |
| 23 | + read -d '' COMMIT_MESSAGE << EOM || true |
| 24 | + ${{ github.event.head_commit.message }} |
| 25 | + EOM |
| 26 | + export COMMIT_MESSAGE |
| 27 | + bash ext/rusefi/firmware/bin/generate_matrix.sh boards |
| 28 | + echo "matrix=$(bash ext/rusefi/firmware/bin/generate_matrix.sh boards)" >> $GITHUB_OUTPUT |
| 29 | +
|
| 30 | + build-firmware: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + needs: [ |
| 33 | + generate-matrix] |
| 34 | + |
| 35 | + if: ${{ ! contains(needs.generate-matrix.outputs.matrix, '[]') }} |
| 36 | + strategy: |
| 37 | + # Let all builds finish even if one fails early |
| 38 | + fail-fast: false |
| 39 | + matrix: ${{fromJson(needs.generate-matrix.outputs.matrix)}} |
| 40 | + |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@v6 |
| 43 | + with: |
| 44 | + submodules: true |
| 45 | + |
| 46 | + - name: Set run variables |
| 47 | + id: set-variables |
| 48 | + run: | |
| 49 | + echo ${{matrix.meta-info}} |
| 50 | + echo MATRIX_META_PATH=${{matrix.meta-info}} >> $GITHUB_OUTPUT |
| 51 | + if [ "${{github.event_name}}" = "schedule" ]; then |
| 52 | + echo "release_date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV |
| 53 | + fi |
| 54 | + if [ "${{github.event_name}}" == "push" -o "${{github.event_name}}" == "schedule" -o "${{github.event_name}}" == "workflow_dispatch" ] && [ "${{github.ref}}" == "refs/heads/master" -o "${{github.ref}}" == "refs/heads/main" ]; then |
| 55 | + echo 'extra_makefile_targets=build_both_bundles' >> $GITHUB_OUTPUT |
| 56 | + # uncomment this line for upload! echo 'upload=ftp_upload_bundles' >> $GITHUB_OUTPUT |
| 57 | + # not pushing from matrix |
| 58 | + echo 'push=true' >> $GITHUB_OUTPUT |
| 59 | + echo 'sim=true' >> $GITHUB_OUTPUT |
| 60 | + else |
| 61 | + echo 'push=false' >> $GITHUB_OUTPUT |
| 62 | + echo 'sim=false' >> $GITHUB_OUTPUT |
| 63 | + fi |
| 64 | +
|
| 65 | +# |
| 66 | +# export ABSOLUTE_BOARD_DIR=/home/rusefi/fw-custom-example/boards/board1 |
| 67 | +# cd /home/rusefi/fw-custom-example/ext/rusefi |
| 68 | +# export |
| 69 | + |
| 70 | + |
| 71 | + - uses: ./ext/rusefi/.github/workflows/custom-board-build |
| 72 | + with: |
| 73 | + meta_info: ${{steps.set-variables.outputs.MATRIX_META_PATH}} |
| 74 | + # bug? feature? 'release_date' above is $GITHUB_ENV not $GITHUB_OUTPUT |
| 75 | + new_tag: ${{steps.set-variables.outputs.release_date}} |
| 76 | + artifacts: bin srec hex list map elf bundle autoupdate |
| 77 | + # see above about un-commenting |
| 78 | + uploads: ini ${{steps.set-variables.outputs.upload}} |
| 79 | + push: ${{steps.set-variables.outputs.push}} |
| 80 | + run_simulator: ${{ steps.set-variables.outputs.sim }} |
| 81 | + MY_REPO_PAT: ${{secrets.MY_REPO_PAT}} |
| 82 | + RUSEFI_ONLINE_FTP_USER: ${{secrets.RUSEFI_ONLINE_FTP_USER}} |
| 83 | + RUSEFI_ONLINE_FTP_PASS: ${{secrets.RUSEFI_ONLINE_FTP_PASS}} |
| 84 | + RUSEFI_FTP_SERVER: ${{secrets.RUSEFI_FTP_SERVER}} |
| 85 | + RUSEFI_SSH_SERVER: ${{secrets.RUSEFI_SSH_SERVER}} |
| 86 | + RUSEFI_SSH_USER: ${{secrets.RUSEFI_SSH_USER}} |
| 87 | + RUSEFI_SSH_PASS: ${{secrets.RUSEFI_SSH_PASS}} |
| 88 | + ADDITIONAL_ENV: ${{secrets.ADDITIONAL_ENV}} |
0 commit comments