Skip to content

Commit

Permalink
TinyFX: Attempt at tidying up repo structure for filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
ZodiusInfuser committed Jul 29, 2024
1 parent fba10c3 commit 489a4eb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions .github/workflows/micropython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -152,55 +154,58 @@ 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}}
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'
uses: actions/upload-release-asset@v1
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
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 489a4eb

Please sign in to comment.