Menu adjustments #93
Workflow file for this run
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: PPUC-DMD | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| version: | |
| name: Detect version | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag: ${{ steps.version.outputs.tag }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - id: version | |
| run: | | |
| VERSION_MAJOR=$(grep -Eo "ZEDMD_VERSION_MAJOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+") | |
| VERSION_MINOR=$(grep -Eo "ZEDMD_VERSION_MINOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+") | |
| VERSION_PATCH=$(grep -Eo "ZEDMD_VERSION_PATCH\s+[0-9]+" src/version.h | grep -Eo "[0-9]+") | |
| TAG="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" | |
| echo "${TAG}" | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| - name: Check git tag | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| GIT_TAG="${GITHUB_REF#refs/tags/}" | |
| EXPECTED_TAG="v${{ steps.version.outputs.tag }}" | |
| if [[ "${GIT_TAG}" != "${EXPECTED_TAG}" ]]; then | |
| echo "Error: Git tag (${GIT_TAG}) does not match version from version.h (v${{ steps.version.outputs.tag }})" | |
| exit 1 | |
| fi | |
| pio-run: | |
| runs-on: ubuntu-latest | |
| needs: [ version ] | |
| strategy: | |
| matrix: | |
| panels: ['pico2_128x32_ppucdmd', 'pico2_256x64_ppucdmd', 'pico2_128x64x2_ppucdmd', 'ppucdmd_128x16', 'ppucdmd_128x32', 'ppucdmd_192x64', 'ppucdmd_256x64', 'ppucdmd_128x64x2'] | |
| name: ${{ matrix.panels }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Cache PlatformIO | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.platformio | |
| key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | |
| - name: Install PlatformIO | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install --upgrade platformio rich_click intelhex | |
| - name: Build firmware | |
| run: | | |
| pio run -e ${{ matrix.panels }} | |
| pio run -e ${{ matrix.panels }} -t buildfs | |
| pio run -e ${{ matrix.panels }} -t buildunified 2>&1 | tee build.log | |
| BUILD_DIR=.pio/build/${{ matrix.panels }} | |
| OFFSET_BIN=$(( $(grep -oE -- '--offset 0x[0-9a-fA-F]+' build.log | grep -oE '0x[0-9a-fA-F]+' | tail -n 1) - 0x10000000 )) | |
| cp $BUILD_DIR/firmware.bin $BUILD_DIR/firmware_with_fs.bin | |
| truncate -s $OFFSET_BIN $BUILD_DIR/firmware_with_fs.bin | |
| cat $BUILD_DIR/littlefs.bin >> $BUILD_DIR/firmware_with_fs.bin | |
| cp $BUILD_DIR/firmware_with_fs.uf2 firmware.uf2 | |
| cp $BUILD_DIR/firmware.uf2 firmware-update.uf2 | |
| cp $BUILD_DIR/firmware_with_fs.bin firmware.bin | |
| cp $BUILD_DIR/firmware.bin firmware-update.bin | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ matrix.panels }} | |
| path: | | |
| firmware.uf2 | |
| firmware-update.uf2 | |
| firmware.bin | |
| firmware-update.bin | |
| post-build: | |
| runs-on: ubuntu-latest | |
| needs: [ version, pio-run ] | |
| name: Release | |
| steps: | |
| - uses: actions/download-artifact@v7 | |
| - name: Package | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| cd ../pico2_128x32_ppucdmd | |
| echo "${{ needs.version.outputs.tag }}" > version.txt | |
| zip ../pico2_128x32_ppucdmd.zip firmware.uf2 firmware-update.uf2 firmware.bin firmware-update.bin version.txt | |
| cd ../pico2_256x64_ppucdmd | |
| echo "${{ needs.version.outputs.tag }}" > version.txt | |
| zip ../pico2_256x64_ppucdmd.zip firmware.uf2 firmware-update.uf2 firmware.bin firmware-update.bin version.txt | |
| cd ../pico2_128x64x2_ppucdmd | |
| echo "${{ needs.version.outputs.tag }}" > version.txt | |
| zip ../pico2_128x64x2_ppucdmd.zip firmware.uf2 firmware-update.uf2 firmware.bin firmware-update.bin version.txt | |
| cd ../ppucdmd_128x16 | |
| echo "${{ needs.version.outputs.tag }}" > version.txt | |
| zip ../ppucdmd_128x16.zip firmware.uf2 firmware-update.uf2 firmware.bin firmware-update.bin version.txt | |
| cd ../ppucdmd_128x32 | |
| echo "${{ needs.version.outputs.tag }}" > version.txt | |
| zip ../ppucdmd_128x32.zip firmware.uf2 firmware-update.uf2 firmware.bin firmware-update.bin version.txt | |
| cd ../ppucdmd_192x64 | |
| echo "${{ needs.version.outputs.tag }}" > version.txt | |
| zip ../ppucdmd_192x64.zip firmware.uf2 firmware-update.uf2 firmware.bin firmware-update.bin version.txt | |
| cd ../ppucdmd_256x64 | |
| echo "${{ needs.version.outputs.tag }}" > version.txt | |
| zip ../ppucdmd_256x64.zip firmware.uf2 firmware-update.uf2 firmware.bin firmware-update.bin version.txt | |
| cd ../ppucdmd_128x64x2 | |
| echo "${{ needs.version.outputs.tag }}" > version.txt | |
| zip ../ppucdmd_128x64x2.zip firmware.uf2 firmware-update.uf2 firmware.bin firmware-update.bin version.txt | |
| cd .. | |
| - name: Release | |
| uses: softprops/action-gh-release@v3 | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| with: | |
| draft: true | |
| files: | | |
| pico2_128x32_ppucdmd.zip | |
| pico2_256x64_ppucdmd.zip | |
| pico2_128x64x2_ppucdmd.zip | |
| ppucdmd_128x16.zip | |
| ppucdmd_128x32.zip | |
| ppucdmd_192x64.zip | |
| ppucdmd_256x64.zip | |
| ppucdmd_128x64x2.zip |