OpenIris/.github/workflows/main.yml
clienthax 5c7027f09b
Fix CI and use double matrix (#35)
Fix pipeline failing due to typo in ArduinoJson include, Fix pin deprecation warning, Add workaround for M5Stack not having a defined camera for now
2022-12-29 23:09:55 +01:00

84 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: false
matrix:
target_name: [
esp32AITinker,
esp32M5Stack,
esp32CAM,
esp_eye,
wrover,
]
target_build_type: [
"",
_release,
_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@v4
with:
python-version: '3.x'
- 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.target_name }}${{ matrix.target_build_type }}
- name: Archive Version File
uses: actions/upload-artifact@v3
with:
name: version
path: ./ESP/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 ./ESP/tools/firmware_name.txt)" >> $GITHUB_ENV
- name: Archive Firmware Files
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target_name }}${{ matrix.target_build_type }}-firmware
path: "./ESP/.pio/build/${{ matrix.target_name }}${{ matrix.target_build_type }}/${{ env.FIRMWARE_NAME }}.bin"
if-no-files-found: error
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 }}