Nightly Release #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Nightly Release | |
| on: | |
| schedule: | |
| - cron: '0 2 * * *' # 2 AM UTC daily | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Release tag (default: today YYYY-MM-DD)' | |
| required: false | |
| jobs: | |
| generate-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| tag: ${{ steps.set-tag.outputs.tag }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| token: ${{ secrets.MY_REPO_PAT }} | |
| - name: Checkout submodules | |
| run: | | |
| git config --global url."https://x-access-token:${{ secrets.MY_REPO_PAT }}@github.com/".insteadOf "git@github.com:" | |
| git submodule update --init --force | |
| - name: Set matrix | |
| id: set-matrix | |
| run: | | |
| export EVENT_NAME="${{ github.event_name }}" | |
| export RUN_ATTEMPT="${{ github.run_attempt }}" | |
| export COMMIT_MESSAGE="" | |
| echo "matrix=$(bash ext/rusefi/firmware/bin/generate_matrix.sh boards)" >> $GITHUB_OUTPUT | |
| - name: Set release tag | |
| id: set-tag | |
| run: | | |
| if [ -n "${{ github.event.inputs.tag }}" ]; then | |
| echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "tag=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
| fi | |
| build: | |
| needs: generate-matrix | |
| runs-on: ubuntu-latest | |
| if: ${{ ! contains(needs.generate-matrix.outputs.matrix, '[]') }} | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| token: ${{ secrets.MY_REPO_PAT }} | |
| - name: Checkout submodules | |
| run: | | |
| git config --global url."https://x-access-token:${{ secrets.MY_REPO_PAT }}@github.com/".insteadOf "git@github.com:" | |
| git submodule update --init --force | |
| - uses: ./ext/rusefi/.github/workflows/custom-board-build | |
| with: | |
| meta_info: ${{ matrix.meta-info }} | |
| push: 'false' | |
| run_simulator: 'false' | |
| artifacts: bundle | |
| uploads: '' | |
| MY_REPO_PAT: ${{ secrets.MY_REPO_PAT }} | |
| ADDITIONAL_ENV: ${{ secrets.ADDITIONAL_ENV }} | |
| release: | |
| needs: [generate-matrix, build] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download bundle artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: downloaded/ | |
| pattern: 'rusefi_bundle_*' | |
| - name: Collect bundle ZIPs | |
| run: | | |
| mkdir -p bundles | |
| for artifact_dir in downloaded/*/; do | |
| artifact_name=$(basename "${artifact_dir%/}") | |
| zip_name="${artifact_name%.zip}.zip" | |
| (cd "$artifact_dir" && zip -r "../../bundles/${zip_name}" .) | |
| echo "Packed: bundles/${zip_name}" | |
| done | |
| - name: List bundles | |
| run: find bundles/ -type f | sort | |
| - name: Read changelog | |
| id: changelog | |
| run: | | |
| if [ -f CHANGELOG.md ]; then | |
| BODY=$(awk '/^## \[/{p++} p==1{print} p==2{exit}' CHANGELOG.md | tail -n +2) | |
| echo "body<<CHANGELOG_EOF" >> $GITHUB_OUTPUT | |
| echo "$BODY" >> $GITHUB_OUTPUT | |
| echo "CHANGELOG_EOF" >> $GITHUB_OUTPUT | |
| else | |
| echo "body=Automated nightly firmware build." >> $GITHUB_OUTPUT | |
| fi | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.generate-matrix.outputs.tag }} | |
| name: Nightly ${{ needs.generate-matrix.outputs.tag }} | |
| prerelease: true | |
| body: | | |
| Automated nightly firmware build for Mazduino boards. | |
| ${{ steps.changelog.outputs.body }} | |
| ## Boards included | |
| - mazduino-compact (STM32F407VGT6, knock enabled) | |
| - mazduino-lite (STM32F407VGT6, no knock) | |
| - mazduino-mini6ch (STM32F427VGT6, ETB + traction control) | |
| - mazduino-mega100 (STM32F407VGT6, 1MB, full features, USB + CAN) | |
| - mazduino-mega100-512 (STM32F407VET6, 512KB, reduced feature set) | |
| ## Bundle contents | |
| Each `.zip` contains: | |
| - `rusefi_console.jar` - rusEFI desktop application (requires Java 11+) | |
| - `rusefi_<board>.ini` - TunerStudio definition file | |
| - `rusefi.bin` - firmware binary (flash via ST-Link or DFU) | |
| - Flash scripts (`flash_dfu.sh`, `flash_stlink.sh`) | |
| ## Flashing | |
| - ST-Link / SWD: run `flash_stlink.sh` or use STM32CubeProgrammer with `rusefi.bin` | |
| - USB DFU: hold BOOT0, then run `flash_dfu.sh` | |
| ## TunerStudio | |
| Launch `rusefi_console.jar` or open TunerStudio and point it to the `.ini` file for your board. | |
| files: bundles/* | |
| - name: Extract INI files from bundles | |
| id: extract-ini | |
| run: | | |
| mkdir -p ini-pages | |
| while IFS= read -r ini; do | |
| [ -f "$ini" ] || continue | |
| SIG=$(grep -oP 'signature\s*=\s*"\K[^"]+' "$ini" | head -1) | |
| SIGPART="${SIG#rusEFI }" | |
| IFS='.' read -r BRANCH YEAR MONTH DAY TARGET HASH <<< "$SIGPART" | |
| if [ -z "$HASH" ]; then | |
| echo "Skipping $ini — could not parse signature: $SIG" | |
| continue | |
| fi | |
| DEST="ini-pages/$BRANCH/$YEAR/$MONTH/$DAY/$TARGET" | |
| mkdir -p "$DEST" | |
| cp "$ini" "$DEST/${HASH}.ini" | |
| echo "Staged: $DEST/${HASH}.ini" | |
| done < <(find downloaded/ -name "*.ini" -type f) | |
| ls -lR ini-pages/ | |
| - name: Deploy INI files to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| deploy_key: ${{ secrets.GHPAGES_DEPLOY_KEY }} | |
| publish_dir: ./ini-pages | |
| destination_dir: ini | |
| keep_files: true |