Skip to content

wip

wip #1140

Workflow file for this run

name: build
on:
push:
pull_request:
workflow_dispatch:
jobs:
targets:
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.set-targets.outputs.targets }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set-targets
run: echo "targets=[$(grep '\[env:' platformio.ini | sed 's/.*:\(.*\)].*/"\1"/' | tr '\n' ',')]" >> $GITHUB_OUTPUT
build:
needs: targets
runs-on: ubuntu-latest
strategy:
matrix:
target: ${{fromJSON(needs.targets.outputs.targets)}}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.target }}-pip
- name: Cache platformio
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ matrix.target }}-platformio
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install platformio
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Build ${{ matrix.target }}
run: |
pio run -e ${{ matrix.target }}
cp .pio/build/${{ matrix.target }}/firmware.hex .pio/build/quicksilver.${{ matrix.target }}.hex
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: .pio/build/quicksilver.${{ matrix.target }}.hex
upload:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: output
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: output/*/quicksilver*.hex