From db6684bf882f5361edc1293887532fb3a59cc1e2 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Sat, 3 Sep 2022 21:06:34 +0100 Subject: [PATCH 1/4] CI: Build filesystem .uf2 with dir2uf2. --- .github/workflows/release-zip.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-zip.yml b/.github/workflows/release-zip.yml index f06eaa1..382d4ad 100644 --- a/.github/workflows/release-zip.yml +++ b/.github/workflows/release-zip.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-20.04 env: - RELEASE_FILE: enviro + RELEASE_FILE: enviro-${{github.event.release.tag_name || github.sha}} steps: - uses: actions/checkout@v2 @@ -20,9 +20,16 @@ jobs: path: enviro submodules: true + - uses: actions/checkout@v2 + with: + repository: gadgetoid/dir2uf2 + path: dir2uf2 + - name: Prepare repository shell: bash run: | + python3 -m pip install littlefs-python + ./dir2uf2/dir2uf2 --manifest dir2uf2/enviro.txt --filename ${{env.RELEASE_FILE}}-filesystem-only.uf2 enviro/ rm -rf enviro/.git* rm -rf enviro/phew/.git* @@ -37,6 +44,12 @@ jobs: name: ${{env.RELEASE_FILE}} path: enviro/ + - name: Store .zip as artifact + uses: actions/upload-artifact@v2 + with: + name: ${{env.RELEASE_FILE}}-filesystem-only + path: ${{env.RELEASE_FILE}}-filesystem-only.uf2 + - name: Upload .zip if: github.event_name == 'release' uses: actions/upload-release-asset@v1 @@ -46,4 +59,15 @@ 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 .uf2 + if: github.event_name == 'release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + asset_path: ${{env.RELEASE_FILE}}-filesystem-only.uf2 + upload_url: ${{github.event.release.upload_url}} + asset_name: ${{env.RELEASE_FILE}}-filesystem-only.uf2 asset_content_type: application/octet-stream \ No newline at end of file From b1bc81b11024f2fa72292244421b76dc454907bb Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Sun, 4 Sep 2022 19:40:35 +0100 Subject: [PATCH 2/4] CI: Append filesystem to firmware .uf2. --- .github/workflows/release-zip.yml | 32 +++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-zip.yml b/.github/workflows/release-zip.yml index 382d4ad..f60c46b 100644 --- a/.github/workflows/release-zip.yml +++ b/.github/workflows/release-zip.yml @@ -13,6 +13,8 @@ jobs: env: 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 @@ -29,7 +31,8 @@ jobs: shell: bash run: | python3 -m pip install littlefs-python - ./dir2uf2/dir2uf2 --manifest dir2uf2/enviro.txt --filename ${{env.RELEASE_FILE}}-filesystem-only.uf2 enviro/ + wget ${{env.FIRMWARE_URL}}/${{env.FIRMWARE_NAME}}.uf2 + ./dir2uf2/dir2uf2 --append-to ${{env.FIRMWARE_NAME}}.uf2 --manifest dir2uf2/enviro.txt --filename ${{env.RELEASE_FILE}}.uf2 enviro/ rm -rf enviro/.git* rm -rf enviro/phew/.git* @@ -44,13 +47,19 @@ jobs: name: ${{env.RELEASE_FILE}} path: enviro/ - - name: Store .zip as artifact + - name: Store filesystem .uf2 as artifact uses: actions/upload-artifact@v2 with: name: ${{env.RELEASE_FILE}}-filesystem-only - path: ${{env.RELEASE_FILE}}-filesystem-only.uf2 + 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 .zip + - name: Upload source .zip if: github.event_name == 'release' uses: actions/upload-release-asset@v1 env: @@ -61,13 +70,24 @@ jobs: asset_name: ${{env.RELEASE_FILE}}.zip asset_content_type: application/octet-stream - - name: Upload .uf2 + - 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}}-filesystem-only.uf2 + 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 From a6f9373f5e109bb4713a5d072bf928b99b0dc545 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Sun, 4 Sep 2022 19:52:06 +0100 Subject: [PATCH 3/4] CI: Target dir2uf2 v0.0.1. Target a tagged release to avoid any changes breaking this workflow. --- .github/workflows/release-zip.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-zip.yml b/.github/workflows/release-zip.yml index f60c46b..8658650 100644 --- a/.github/workflows/release-zip.yml +++ b/.github/workflows/release-zip.yml @@ -25,6 +25,7 @@ jobs: - uses: actions/checkout@v2 with: repository: gadgetoid/dir2uf2 + ref: v0.0.1 path: dir2uf2 - name: Prepare repository From fdfee0fafe27307bd77293fc6923b26cd7c1c1a7 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Sun, 4 Sep 2022 19:57:21 +0100 Subject: [PATCH 4/4] CI: Use local manifest. --- .github/workflows/release-zip.yml | 2 +- uf2-manifest.txt | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 uf2-manifest.txt diff --git a/.github/workflows/release-zip.yml b/.github/workflows/release-zip.yml index 8658650..9621039 100644 --- a/.github/workflows/release-zip.yml +++ b/.github/workflows/release-zip.yml @@ -33,7 +33,7 @@ jobs: run: | python3 -m pip install littlefs-python wget ${{env.FIRMWARE_URL}}/${{env.FIRMWARE_NAME}}.uf2 - ./dir2uf2/dir2uf2 --append-to ${{env.FIRMWARE_NAME}}.uf2 --manifest dir2uf2/enviro.txt --filename ${{env.RELEASE_FILE}}.uf2 enviro/ + ./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* 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