OpenIris/.github/workflows/main.yml
2022-12-15 01:09:52 +00:00

83 lines
2.6 KiB
YAML

name: Build and Release the OpenIris bin files
on:
push:
branches:
- "mdns-autodiscovery"
- "master"
pull_request:
branches:
- "master"
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: true
matrix:
targets: [esp32CAM_release,
# esp32AITinker_release,
# esp_eye_release,
# esp32M5Stack_release,
# wrover_release,
# esp32CAM,
# esp32AITinker,
# esp32M5Stack,
# esp_eye,
# wrover,
# esp32CAM_OTA,
# esp32AITinker_OTA,
# esp32M5Stack_OTA,
# esp_eye_OTA,
# wrover_OTA,
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Setup Python install
uses: actions/setup-python@v3
- name: Install PlatformIO with Pip
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Build OpenIris Firmware
working-directory: ./ESP
run: pio run --environment ${{ matrix.targets }}
- name: Archive Version File
uses: actions/upload-artifact@v3
with:
name: version
path: ./tools/version.txt
- name: Archive Firmware name File
# create an environment variable with the name of the firmware file by catting the firmware_name.txt file
run: echo "FIRMWARE_NAME=$(cat ./tools/firmware_name.txt)" >> $GITHUB_ENV
- name: Archive Firmware Files
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.targets }}-firmware
path: "./ESP/.pio/build/${{ matrix.targets }}/$FIRMWARE_NAME.bin"
release-openiris:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download Firmware Files
uses: actions/download-artifact@v2
with:
path: release
- name: Release Firmware
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/')
with:
artifacts: release/*/*.bin
generateReleaseNotes: true
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}