138 lines
5.4 KiB
YAML
138 lines
5.4 KiB
YAML
name: Build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- ratgdo32
|
|
pull_request:
|
|
schedule:
|
|
- cron: '0 4 * * 1'
|
|
|
|
jobs:
|
|
build:
|
|
name: Build ${{ matrix.firmware.name }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
firmware:
|
|
- file: v2board_esp8266_d1_mini_lite.yaml
|
|
name: V2.0 Board ESP8266 D1 Mini Lite Security+ 2.0
|
|
manifest_filename: v2board_esp8266_d1_mini_lite-manifest.json
|
|
- file: v2board_esp8266_d1_mini.yaml
|
|
name: V2.0 Board ESP8266 D1 Mini Security+ 2.0
|
|
manifest_filename: v2board_esp8266_d1_mini-manifest.json
|
|
- file: v2board_esp32_d1_mini.yaml
|
|
name: V2.0 Board ESP32 D1 Mini Security+ 2.0
|
|
manifest_filename: v2board_esp32_d1_mini-manifest.json
|
|
- file: v2board_esp32_lolin_s2_mini.yaml
|
|
name: V2.0 Board ESP32 lolin S2 mini Security+ 2.0
|
|
manifest_filename: v2board_esp32_lolin_s2_mini-manifest.json
|
|
- file: v25board_esp8266_d1_mini_lite.yaml
|
|
name: V2.5 Board ESP8266 D1 Mini Lite Security+ 2.0
|
|
manifest_filename: v25board_esp8266_d1_mini_lite-manifest.json
|
|
- file: v25board_esp8266_d1_mini_lite_secplusv1.yaml
|
|
name: V2.5 Board ESP8266 D1 Mini Lite Security+ 1.0
|
|
manifest_filename: v25board_esp8266_d1_mini_lite_secplusv1-manifest.json
|
|
- file: v25board_esp8266_d1_mini.yaml
|
|
name: V2.5 Board ESP8266 D1 Mini Security+ 2.0
|
|
manifest_filename: v25board_esp8266_d1_mini-manifest.json
|
|
- file: v25board_esp8266_d1_mini_secplusv1.yaml
|
|
name: V2.5 Board ESP8266 D1 Mini Security+ 1.0
|
|
manifest_filename: v25board_esp8266_d1_mini_secplusv1-manifest.json
|
|
- file: v25board_esp32_d1_mini.yaml
|
|
name: V2.5 Board ESP32 D1 Mini Security+ 2.0
|
|
manifest_filename: v25board_esp32_d1_mini-manifest.json
|
|
- file: v25board_esp32_d1_mini_secplusv1.yaml
|
|
name: V2.5 Board ESP32 D1 Mini Security+ 1.0
|
|
manifest_filename: v25board_esp32_d1_mini_secplusv1-manifest.json
|
|
- file: v25iboard.yaml
|
|
name: V2.5i Board Security+ 2.0
|
|
manifest_filename: v25iboard-manifest.json
|
|
- file: v25iboard_secplusv1.yaml
|
|
name: V2.5i Board Security+ 1.0
|
|
manifest_filename: v25iboard_secplusv1-manifest.json
|
|
- file: v25iboard_drycontact.yaml
|
|
name: V2.5i Board Dry Contact
|
|
manifest_filename: v25iboard_drycontact-manifest.json
|
|
- file: v32board.yaml
|
|
name: V32 Board Security+ 2.0
|
|
manifest_filename: v32board-manifest.json
|
|
- file: v32board_secplusv1.yaml
|
|
name: V32 Board Security+ 1.0
|
|
manifest_filename: v32board_secplusv1-manifest.json
|
|
- file: v32board_drycontact.yaml
|
|
name: V32 Board Board Dry Contact
|
|
manifest_filename: v32board_drycontact-manifest.json
|
|
- file: v32disco.yaml
|
|
name: V32 Disco Board Security+ 2.0
|
|
manifest_filename: v32disco-manifest.json
|
|
- file: v32disco_secplusv1.yaml
|
|
name: V32 Disco Board Security+ 1.0
|
|
manifest_filename: v32disco_secplusv1-manifest.json
|
|
- file: v32disco_drycontact.yaml
|
|
name: V32 Disco Board Dry Contact
|
|
manifest_filename: v32disco_drycontact-manifest.json
|
|
fail-fast: false
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v3.3.0
|
|
- name: Build firmware
|
|
uses: ratgdo/esphome-build-action@main
|
|
id: esphome-build
|
|
with:
|
|
yaml_file: ${{ matrix.firmware.file }}
|
|
version: latest
|
|
- name: Copy firmware and manifest
|
|
run: |
|
|
mkdir output
|
|
mv ${{ steps.esphome-build.outputs.name }} output/
|
|
jq -s '{"name": "${{ matrix.firmware.name }}", "new_install_improv_wait_time": 15, "new_install_prompt_erase": true, "version": "${{ steps.esphome-build.outputs.esphome-version }}", "home_assistant_domain": "esphome", "new_install_skip_erase": false, "builds":.}' output/${{ steps.esphome-build.outputs.name }}/manifest.json > output/${{ matrix.firmware.manifest_filename }}
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3.1.2
|
|
with:
|
|
name: ${{ matrix.firmware.name }}
|
|
path: output
|
|
|
|
|
|
consolidate:
|
|
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/ratgdo32'
|
|
name: Consolidate firmwares
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v3
|
|
- name: Download built firmwares
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
path: firmwares
|
|
- name: Copy files
|
|
run: |-
|
|
mkdir output
|
|
cp -R static/* output/
|
|
cp -R firmwares/*/* output/
|
|
- name: Upload GitHub Pages artifact
|
|
uses: actions/upload-pages-artifact@v2.0.0
|
|
with:
|
|
path: output
|
|
|
|
deploy:
|
|
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/ratgdo32'
|
|
name: Deploy to GitHub Pages
|
|
runs-on: ubuntu-latest
|
|
needs: consolidate
|
|
permissions:
|
|
pages: write
|
|
id-token: write
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- name: Setup Pages
|
|
uses: actions/configure-pages@v2
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v1.2.9
|