@@ -34,11 +34,14 @@ jobs:
3434 # MicroPython version will be contained in github.event.release.tag_name for releases
3535 RELEASE_FILE : ${{ matrix.name }}-${{ github.event.release.tag_name || github.sha }}-micropython
3636 PIMORONI_PICO_DIR : " ${{ github.workspace }}/pimoroni-pico"
37- MICROPY_BOARD_DIR : " ${{ github.workspace }}/src-${{ github.sha }}/${{ matrix.BOARD }}"
3837 USER_C_MODULES : " ${{ github.workspace }}/src-${{ github.sha }}/modules/${{ matrix.modules }}.cmake"
38+ USER_FS_MANIFEST : " ${{ github.workspace }}/src-${{ github.sha }}/modules/${{ matrix.modules }}.txt"
39+ USER_FS_SOURCE : " ${{ github.workspace }}/src-${{ github.sha }}/modules/littlefs"
3940 TAG_OR_SHA : ${{ github.event.release.tag_name || github.sha }}
4041 MICROPY_BOARD : ${{ matrix.board }}
4142 MICROPY_BOARD_VARIANT : ${{ matrix.variant }}
43+ MICROPY_BOARD_DIR : " ${{ github.workspace }}/src-${{ github.sha }}/${{ matrix.BOARD }}"
44+ MICROPY_FROZEN_MANIFEST : " ${{ github.workspace }}/src-${{ github.sha }}/modules/${{ matrix.modules }}.py"
4245 BOARD_NAME : ${{ matrix.name }}
4346 BUILD_TOOLS : src-${{ github.sha }}/ci/micropython.sh
4447
@@ -81,12 +84,19 @@ jobs:
8184 source $BUILD_TOOLS
8285 micropython_clone
8386
84- - name : " Py_Decl: Checkout py_decl "
87+ - name : " Py_Decl: Checkout"
8588 uses : actions/checkout@v4
8689 with :
8790 repository : gadgetoid/py_decl
8891 ref : v0.0.2
8992 path : py_decl
93+
94+ - name : " dir2uf2: Checkout"
95+ uses : actions/checkout@v4
96+ with :
97+ repository : gadgetoid/dir2uf2
98+ ref : v0.0.7
99+ path : dir2uf2
90100
91101 - name : " MicroPython: Build MPY Cross"
92102 run : |
@@ -106,24 +116,47 @@ jobs:
106116 source $BUILD_TOOLS
107117 cmake_build
108118
109- - name : " Py_Decl: Verify UF2 "
119+ - name : " Py_Decl: Verify .uf2 "
110120 shell : bash
111121 run : |
112122 python3 py_decl/py_decl.py --to-json --verify build-${{ matrix.name }}/${{ env.RELEASE_FILE }}.uf2
113123
114- - name : Store .uf2 as artifact
124+ - name : " dir2uf2: Append filesystem to .uf2"
125+ shell : bash
126+ run : |
127+ python3 -m pip install littlefs-python==0.12.0
128+ ./dir2uf2/dir2uf2 --fs-compact --append-to build-${{ matrix.name }}/${{ env.RELEASE_FILE }}.uf2 --manifest ${{env.USER_FS_MANIFEST}} --filename with-filesystem.uf2 ${{env.USER_FS_SOURCE}}/
129+
130+ - name : " Artifacts: Upload .uf2"
115131 uses : actions/upload-artifact@v4
116132 with :
117133 name : ${{ env.RELEASE_FILE }}.uf2
118134 path : build-${{ matrix.name }}/${{ env.RELEASE_FILE }}.uf2
119135
120- - name : Upload .uf2
136+ - name : " Artifacts: Upload .uf2 with filesystem"
137+ uses : actions/upload-artifact@v4
138+ with :
139+ name : ${{ env.RELEASE_FILE }}-with-filesystem.uf2
140+ path : ${{ env.RELEASE_FILE }}-with-filesystem.uf2
141+
142+ - name : " Release: Upload .uf2"
121143 if : github.event_name == 'release'
122144 uses : actions/upload-release-asset@v1
123145 env :
124146 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
125147 with :
126- asset_path : build-${{ matrix.name }}/firmware .uf2
148+ asset_path : build-${{ matrix.name }}/${{ env.RELEASE_FILE }} .uf2
127149 upload_url : ${{ github.event.release.upload_url }}
128150 asset_name : ${{ env.RELEASE_FILE }}.uf2
151+ asset_content_type : application/octet-stream
152+
153+ - name : " Release: Upload .uf2 with filesystem"
154+ if : github.event_name == 'release'
155+ uses : actions/upload-release-asset@v1
156+ env :
157+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
158+ with :
159+ asset_path : ${{ env.RELEASE_FILE }}-with-filesystem.uf2
160+ upload_url : ${{ github.event.release.upload_url }}
161+ asset_name : ${{ env.RELEASE_FILE }}-with-filesystem.uf2
129162 asset_content_type : application/octet-stream
0 commit comments