diff --git a/.github/workflows/filesystem.yml b/.github/workflows/filesystem.yml new file mode 100644 index 0000000..9c67023 --- /dev/null +++ b/.github/workflows/filesystem.yml @@ -0,0 +1,65 @@ +name: Zip Files + +on: + push: + pull_request: + release: + types: [created] + +jobs: + build: + name: Build ${{matrix.name}} + runs-on: ubuntu-20.04 + strategy: + matrix: + include: + - name: TinyFX + shortname: tiny_fx + board: PIMORONI_TINYFX + + env: + RELEASE_FILE: ${{matrix.shortname}}-${{github.event.release.tag_name || github.sha}} + 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}}" + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + path: picofx + + - name: Libs .zip artifact + uses: actions/upload-artifact@v4 + with: + name: ${{env.RELEASE_FILE}}-libs-only + path: ${{env.ROOT_DIR}}/picofx + + - name: Examples .zip artifact + uses: actions/upload-artifact@v4 + with: + name: ${{env.RELEASE_FILE}}-examples-only + path: ${{env.EXAMPLES_DIR}} + + - name: Libs .zip release asset + if: github.event_name == 'release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + asset_path: ${{env.ROOT_DIR}}/picofx + upload_url: ${{github.event.release.upload_url}} + asset_name: ${{env.RELEASE_FILE}}-libs-only + asset_content_type: application/octet-stream + + - name: Examples .zip release asset + if: github.event_name == 'release' + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + with: + asset_path: ${{env.EXAMPLES_DIR}} + upload_url: ${{github.event.release.upload_url}} + asset_name: ${{env.RELEASE_FILE}}-examples-only + asset_content_type: application/octet-stream