diff --git a/.github/workflows/release-zip.yml b/.github/workflows/release-zip.yml index f06eaa1..9621039 100644 --- a/.github/workflows/release-zip.yml +++ b/.github/workflows/release-zip.yml @@ -12,7 +12,9 @@ jobs: runs-on: ubuntu-20.04 env: - RELEASE_FILE: enviro + RELEASE_FILE: enviro-${{github.event.release.tag_name || github.sha}} + FIRMWARE_NAME: pimoroni-picow_enviro-1.19.7-micropython + FIRMWARE_URL: https://github.com/pimoroni/pimoroni-pico/releases/download/1.19.7/ steps: - uses: actions/checkout@v2 @@ -20,9 +22,18 @@ jobs: path: enviro submodules: true + - uses: actions/checkout@v2 + with: + repository: gadgetoid/dir2uf2 + ref: v0.0.1 + path: dir2uf2 + - name: Prepare repository shell: bash run: | + python3 -m pip install littlefs-python + wget ${{env.FIRMWARE_URL}}/${{env.FIRMWARE_NAME}}.uf2 + ./dir2uf2/dir2uf2 --append-to ${{env.FIRMWARE_NAME}}.uf2 --manifest enviro/uf2-manifest.txt --filename ${{env.RELEASE_FILE}}.uf2 enviro/ rm -rf enviro/.git* rm -rf enviro/phew/.git* @@ -37,7 +48,19 @@ jobs: name: ${{env.RELEASE_FILE}} path: enviro/ - - name: Upload .zip + - name: Store filesystem .uf2 as artifact + uses: actions/upload-artifact@v2 + with: + name: ${{env.RELEASE_FILE}}-filesystem-only + path: ${{env.RELEASE_FILE}}.uf2 + + - name: Store full .uf2 as artifact + uses: actions/upload-artifact@v2 + with: + name: ${{env.FIRMWARE_NAME}}-${{env.RELEASE_FILE}}.uf2 + path: ${{env.FIRMWARE_NAME}}-${{env.RELEASE_FILE}}.uf2 + + - name: Upload source .zip if: github.event_name == 'release' uses: actions/upload-release-asset@v1 env: @@ -46,4 +69,26 @@ jobs: asset_path: ${{env.RELEASE_FILE}}.zip upload_url: ${{github.event.release.upload_url}} asset_name: ${{env.RELEASE_FILE}}.zip + asset_content_type: application/octet-stream + + - name: Upload filesystem .uf2 + if: github.event_name == 'release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + asset_path: ${{env.RELEASE_FILE}}.uf2 + upload_url: ${{github.event.release.upload_url}} + asset_name: ${{env.RELEASE_FILE}}-filesystem-only.uf2 + asset_content_type: application/octet-stream + + - name: Upload full firmware .uf2 + if: github.event_name == 'release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + asset_path: ${{env.FIRMWARE_NAME}}-${{env.RELEASE_FILE}}.uf2 + upload_url: ${{github.event.release.upload_url}} + asset_name: ${{env.FIRMWARE_NAME}}-${{env.RELEASE_FILE}}.uf2 asset_content_type: application/octet-stream \ No newline at end of file diff --git a/uf2-manifest.txt b/uf2-manifest.txt new file mode 100644 index 0000000..4b8b23b --- /dev/null +++ b/uf2-manifest.txt @@ -0,0 +1,8 @@ +main.py +enviro/*.py +enviro/boards/*.py +enviro/destinations/*.py +enviro/html/*.html +enviro/html/images/* +phew/__init__.py +phew/phew/*.py \ No newline at end of file