Skip to content

Commit

Permalink
Merge pull request #53 from pimoroni/ci/uf2
Browse files Browse the repository at this point in the history
CI: Build filesystem .uf2 with dir2uf2.
  • Loading branch information
Gadgetoid authored Sep 4, 2022
2 parents c86cd67 + fdfee0f commit 33dead6
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
49 changes: 47 additions & 2 deletions .github/workflows/release-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,28 @@ 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
with:
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*
Expand All @@ -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:
Expand All @@ -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
8 changes: 8 additions & 0 deletions uf2-manifest.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 33dead6

Please sign in to comment.