OpenIris/.github/workflows/build_release_bins.yml
2022-12-15 03:11:54 +00:00

96 lines
3.1 KiB
YAML

name: Build and Release the OpenIris bin files
on:
push:
tags: v[1-9]+.[0-9]+.[0-9]+
branches:
- "feature/mdns-autodiscovery"
- "master"
pull_request:
tags: v[1-9]+.[0-9]+.[0-9]+
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: ./ESP/tools/version.txt
retention-days: 1
- 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.targets }}-firmware
path: ./ESP/.pio/build/${{ matrix.targets }}/${{ env.FIRMWARE_NAME }}.bin
retention-days: 1
release-openiris:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3
- name: Download Firmware Files
uses: actions/download-artifact@v2
with:
path: release
- name: Create Env Variable with Version
run: echo "VERSION=$(cat ./release/version/version.txt)" >> $GITHUB_ENV
- name: Create tag name
uses: rickstaa/action-create-tag@v1
with:
tag: ${{ env.VERSION }}
message: "Latest release of OpenIris firmware"
- name: Release Firmware
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
artifacts: release/${{ matrix.targets }}/*.bin
tag: ${{ env.VERSION }}
generateReleaseNotes: true
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}