Skip to content

Merge pull request #9 from pimoroni/patch/w_examples #133

Merge pull request #9 from pimoroni/patch/w_examples

Merge pull request #9 from pimoroni/patch/w_examples #133

Workflow file for this run

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
- name: TinyFX W
shortname: tiny_fx_w
board: PIMORONI_TINYFX
env:
RELEASE_FILE: ${{matrix.shortname}}-${{github.event.release.tag_name || github.sha}}
ROOT_DIR: "picofx"
BOARD_DIR: "picofx/boards/${{matrix.board}}"
LIBS_DIR: "picofx/lib_temp"
EX_DIR: "picofx/ex_temp"
steps:
- uses: actions/checkout@v4
with:
submodules: true
path: picofx
- name: "Assemble lib content"
shell: bash
run: |
mkdir -p ${{env.LIBS_DIR}}/lib
cp -v -r ${{env.ROOT_DIR}}/picofx ${{env.LIBS_DIR}}/lib
cp -v -r ${{env.BOARD_DIR}}/visible_libs/. ${{env.LIBS_DIR}}/lib
rm -v ${{env.LIBS_DIR}}/lib/picofx/README.md
- name: "Assemble example content"
shell: bash
run: |
mkdir -p ${{env.EX_DIR}}
cp -v -r picofx/examples/tiny_fx/. ${{env.EX_DIR}}
rm -v ${{env.EX_DIR}}/README.md
rm -v -r ${{env.EX_DIR}}/examples/audio/photon_sword
rm -v ${{env.EX_DIR}}/examples/audio/photon_sword.py
- name: "Append W example content"
if: matrix.shortname == 'tiny_fx_w'
shell: bash
run: |
cp -v -r picofx/examples/tiny_fx_w/. ${{env.EX_DIR}}
rm -v ${{env.EX_DIR}}/README.md
- name: Libs .zip artifact
if: matrix.shortname == 'tiny_fx'
uses: actions/upload-artifact@v4
with:
name: ${{env.RELEASE_FILE}}-libraries-only
path: picofx/lib_temp
- name: Examples .zip artifact
uses: actions/upload-artifact@v4
with:
name: ${{env.RELEASE_FILE}}-examples-only
path: "picofx/ex_temp"
- name: Libs .zip release asset
if: github.event_name == 'release' && matrix.shortname == 'tiny_fx'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
asset_path: picofx/lib_temp
upload_url: ${{github.event.release.upload_url}}
asset_name: ${{env.RELEASE_FILE}}-libraries-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: "picofx/ex_temp"
upload_url: ${{github.event.release.upload_url}}
asset_name: ${{env.RELEASE_FILE}}-examples-only
asset_content_type: application/octet-stream