ESPresense/.github/workflows/main.yml

57 lines
1.8 KiB
YAML
Raw Normal View History

name: Build and Attach Releases
on:
push:
branches:
- master
tags:
- v*
pull_request:
release:
types: [published]
2021-03-14 15:34:37 +01:00
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
pio platform update
2021-03-20 03:22:25 +01:00
pio run -t clean
- name: Set env
run: echo "PLATFORMIO_BUILD_FLAGS=-DVERSION='\"${GITHUB_REF#refs/*/}\"'" >> $GITHUB_ENV
2021-09-28 16:03:24 +02:00
if: startsWith(github.ref, 'refs/tags/v')
2021-03-14 15:34:37 +01:00
- name: Run PlatformIO
2021-09-25 16:46:19 +02:00
run: pio run -e esp32 -e esp32-verbose -e adafruit-huzzah32 -e m5stickc -e m5stickc-plus -e m5atom-matrix -e macchina-a0
2021-03-14 15:34:37 +01:00
- name: Rename firmware
run: |
cp .pio/build/esp32/firmware.bin esp32.bin
cp .pio/build/esp32-verbose/firmware.bin esp32-verbose.bin
2021-09-25 16:46:19 +02:00
cp .pio/build/adafruit-huzzah32/firmware.bin adafruit-huzzah32.bin
2021-03-14 15:34:37 +01:00
cp .pio/build/m5stickc/firmware.bin m5stickc.bin
cp .pio/build/m5stickc-plus/firmware.bin m5stickc-plus.bin
2021-03-27 15:58:54 +01:00
cp .pio/build/m5atom-matrix/firmware.bin m5atom-matrix.bin
2021-09-22 02:51:54 +02:00
cp .pio/build/macchina-a0/firmware.bin macchina-a0.bin
2021-03-14 15:34:37 +01:00
- name: Release
uses: softprops/action-gh-release@v1
2021-09-28 16:03:24 +02:00
if: startsWith(github.ref, 'refs/tags/v')
2021-03-14 15:34:37 +01:00
with:
files: "*.bin"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}