diff --git a/.github/workflows/micropython.yml b/.github/workflows/micropython.yml index 2f920eb..2f2f8dc 100644 --- a/.github/workflows/micropython.yml +++ b/.github/workflows/micropython.yml @@ -66,12 +66,14 @@ jobs: board: PIMORONI_TINYFX env: - RELEASE_FILE: pimoroni-${{matrix.shortname}}-${{github.event.release.tag_name || github.sha}}-micropython.uf2 - RELEASE_FILE_WITH_OS: pimoroni-${{matrix.shortname}}-${{github.event.release.tag_name || github.sha}}-micropython-with-examples.uf2 + RELEASE_FILE: pimoroni-${{matrix.shortname}}-${{github.event.release.tag_name || github.sha}}-micropython FIRMWARE_DIR: "$GITHUB_WORKSPACE/picofx/boards" ROOT_DIR: "$GITHUB_WORKSPACE/picofx" BOARD_DIR: "$GITHUB_WORKSPACE/picofx/boards/${{matrix.board}}" EXAMPLES_DIR: "$GITHUB_WORKSPACE/picofx/examples/${{matrix.shortname}}" + FILESYSTEM_DIR: "$GITHUB_WORKSPACE/picofx/temp" + FILESYSTEM_SUFFIX: "with-libs-and-examples" + BOARD: "PIMORONI_TINYFX" steps: - name: Compiler Cache @@ -123,12 +125,12 @@ jobs: working-directory: micropython run: | git apply "${{env.FIRMWARE_DIR}}/932f76c6ba64c5a3e68de3324556d9979f09303b.patch" - + - name: Install Arm GNU Toolchain (arm-none-eabi-gcc) uses: carlosperate/arm-none-eabi-gcc-action@v1 with: release: '9-2020-q2' - + - name: Install CCache run: | sudo apt update && sudo apt install ccache @@ -152,36 +154,39 @@ jobs: shell: bash working-directory: micropython/ports/rp2/build run: | - cp firmware.uf2 ${{env.RELEASE_FILE}} + cp firmware.uf2 ${{env.RELEASE_FILE}}.uf2 - name: "Py_Decl: Verify UF2" shell: bash run: | - python3 py_decl/py_decl.py --to-json --verify micropython/ports/rp2/build/${{ env.RELEASE_FILE }} + python3 py_decl/py_decl.py --to-json --verify micropython/ports/rp2/build/${{ env.RELEASE_FILE }}.uf2 - name: "HACK: Mangle PicoFX Lib into user filesystem" shell: bash run: | - mkdir -p ${{env.EXAMPLES_DIR}}/lib - cp -v -r ${{env.ROOT_DIR}}/picofx ${{env.EXAMPLES_DIR}}/lib + mkdir -p ${{env.FILESYSTEM_DIR}}/lib + cp -v -r ${{env.ROOT_DIR}}/picofx ${{env.FILESYSTEM_DIR}}/lib + cp -v -r ${{env.BOARD_DIR}}/visible_libs/. ${{env.FILESYSTEM_DIR}}/lib + cp -v -r ${{env.EXAMPLES_DIR}}/. ${{env.FILESYSTEM_DIR}} - name: Append Filesystem shell: bash run: | python3 -m pip install littlefs-python==0.12.0 - ./dir2uf2/dir2uf2 --fs-compact --append-to micropython/ports/rp2/build/${{env.RELEASE_FILE}} --manifest ${{env.EXAMPLES_DIR}}/uf2-manifest.txt --filename with-examples.uf2 ${{env.EXAMPLES_DIR}}/ + ./dir2uf2/dir2uf2 --fs-compact --append-to micropython/ports/rp2/build/${{env.RELEASE_FILE}}.uf2 --manifest ${{env.BOARD_DIR}}/uf2-manifest.txt --filename ${{env.FILESYSTEM_SUFFIX}}.uf2 ${{env.FILESYSTEM_DIR}}/ + - name: Store .uf2 as artifact uses: actions/upload-artifact@v4 with: name: ${{env.RELEASE_FILE}} - path: micropython/ports/rp2/build/${{env.RELEASE_FILE}} + path: micropython/ports/rp2/build/${{env.RELEASE_FILE}}.uf2 - - name: Store .uf2 + Examples as artifact + - name: Store .uf2 + Filesystem as artifact uses: actions/upload-artifact@v4 with: - name: ${{env.RELEASE_FILE_WITH_OS}} - path: ${{env.RELEASE_FILE_WITH_OS}} + name: ${{env.RELEASE_FILE}}-${{env.FILESYSTEM_SUFFIX}} + path: ${{env.RELEASE_FILE}}-${{env.FILESYSTEM_SUFFIX}}.uf2 - name: Upload .uf2 if: github.event_name == 'release' @@ -189,18 +194,18 @@ jobs: env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} with: - asset_path: micropython/ports/rp2/build/${{env.RELEASE_FILE}} + asset_path: micropython/ports/rp2/build/${{env.RELEASE_FILE}}.uf2 upload_url: ${{github.event.release.upload_url}} - asset_name: ${{env.RELEASE_FILE}} + asset_name: ${{env.RELEASE_FILE}}.uf2 asset_content_type: application/octet-stream - - name: Upload .uf2 + Examples + - name: Upload .uf2 + Filesystem if: github.event_name == 'release' uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} with: - asset_path: ${{env.RELEASE_FILE_WITH_OS}} + asset_path: ${{env.RELEASE_FILE}}-${{env.FILESYSTEM_SUFFIX}}.uf2 upload_url: ${{github.event.release.upload_url}} - asset_name: ${{env.RELEASE_FILE_WITH_OS}} + asset_name: ${{env.RELEASE_FILE}}-${{env.FILESYSTEM_SUFFIX}}.uf2 asset_content_type: application/octet-stream diff --git a/examples/tiny_fx/uf2-manifest.txt b/boards/PIMORONI_TINYFX/uf2-manifest.txt similarity index 100% rename from examples/tiny_fx/uf2-manifest.txt rename to boards/PIMORONI_TINYFX/uf2-manifest.txt diff --git a/examples/tiny_fx/lib/audio.py b/boards/PIMORONI_TINYFX/visible_libs/audio.py similarity index 100% rename from examples/tiny_fx/lib/audio.py rename to boards/PIMORONI_TINYFX/visible_libs/audio.py diff --git a/examples/tiny_fx/lib/tiny_fx.py b/boards/PIMORONI_TINYFX/visible_libs/tiny_fx.py similarity index 100% rename from examples/tiny_fx/lib/tiny_fx.py rename to boards/PIMORONI_TINYFX/visible_libs/tiny_fx.py