Split build steps #49
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- v16 | |
- master | |
- bugfixes | |
# tags: | |
# - "v*" | |
# pull_request: | |
# types: [ open, synchronize, edited, reopened, closed ] | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build bins for ${{ matrix.pio_env }} | |
strategy: | |
# Ensure that a builder finishes even if another fails | |
fail-fast: false | |
matrix: | |
pio_env: ['esp32_wifi_tft', 'esp32_wifi_iic', 'esp8266_wifi', 'esp32_s2_wifi', 'esp32_wifi_espi'] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- run: git fetch --prune --unshallow | |
- name: Cache pip | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Cache PlatformIO | |
uses: actions/cache@v4 | |
with: | |
path: ~/.platformio | |
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install PlatformIO | |
run: | | |
python -m pip install --upgrade pip | |
pip install --upgrade platformio | |
- name: Build firmware | |
run: | | |
pio run -e ${{ matrix.pio_env }} | |
- name: Copy firmware files | |
run: | | |
if [ -f .pio/build/${{ matrix.pio_env }}/firmware.bin ]; then | |
cp .pio/build/${{ matrix.pio_env }}/firmware.bin bin/${{ matrix.pio_env }}_firmware.bin | |
echo "Firmware copied" | |
fi | |
if [ -f .pio/build/${{ matrix.pio_env }}/partitions.bin ]; then | |
cp .pio/build/${{ matrix.pio_env }}/partitions.bin bin/${{ matrix.pio_env }}_partitions.bin | |
echo "Partitions copied" | |
fi | |
- name: Build filesystem | |
run: | | |
pio run -e ${{ matrix.pio_env }} --target buildfs | |
# sh ./copy_bins.sh | |
- name: Copy filesystem files | |
run: | | |
if [ -f .pio/build/${{ matrix.pio_env }}/spiffs.bin ]; then | |
cp .pio/build/${{ matrix.pio_env }}/spiffs.bin bin/${{ matrix.pio_env }}_spiffs.bin | |
echo "Spiffs copied" | |
fi | |
if [ -f .pio/build/${{ matrix.pio_env }}/littlefs.bin ]; then | |
cp .pio/build/${{ matrix.pio_env }}/littlefs.bin bin/${{ matrix.pio_env }}_spiffs.bin | |
echo "LittleFS copied" | |
fi | |
# TODO - Change the above from _spiffs to _filesystem | |
- name: Create Draft Release | |
uses: softprops/action-gh-release@v1 | |
# if: startsWith(github.ref, 'refs/tags/') | |
with: | |
body: "Draft release" | |
# note you'll typically need to create a personal access token | |
# with permissions to create releases in the other repo | |
token: ${{ secrets.GITHUB_TOKEN }} | |
draft: true | |
prerelease: true | |
files: | | |
LICENSE | |
bin/*.bin | |
env: | |
GITHUB_REPOSITORY: thorrak/brewpi-esp8266 |