update ci

This commit is contained in:
tarontop
2025-01-14 13:33:49 +08:00
parent 2655ad5e0d
commit 80cbae7584
7 changed files with 151 additions and 46 deletions
+31 -14
View File
@@ -2,28 +2,45 @@ name: CI
on:
pull_request:
paths:
- '*.yaml'
- '.github/workflows/ci.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
ci:
name: Building ${{ matrix.file }}
name: Building ${{ matrix.file }} / ${{ matrix.esphome-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 3
matrix:
#### Modify below here to match your project ####
file:
- athom-2ch-relay-board.yaml
- athom-4ch-relay-board.yaml
- athom-8ch-relay-board.yaml
- athom-energy-monitor-x2.yaml
- athom-energy-monitor-x6.yaml
- athom-garage-door.yaml
- athom-mini-relay-v2.yaml
- athom-smart-plug.yaml
- athom-zigbee-gateway.yaml
- athom-presence-sensor-v3.yaml
- athom-2ch-relay-board
- athom-4ch-relay-board
- athom-8ch-relay-board
- athom-energy-monitor-x2
- athom-energy-monitor-x6
- athom-garage-door
- athom-mini-relay-v2
- athom-smart-plug
- athom-zigbee-gateway
- athom-presence-sensor-v3
#### Modify above here to match your project ####
esphome-version:
- stable
- beta
- dev
steps:
- name: Checkout source code
uses: actions/checkout@v4.1.7
- name: Build ESPHome firmware to verify configuration
uses: esphome/build-action@v4.0.1
- name: ESPHome ${{ matrix.esphome-version }}
uses: esphome/build-action@v4.0.3
with:
yaml-file: ${{ matrix.file }}
yaml-file: ${{ matrix.file }}.yaml
version: ${{ matrix.esphome-version }}
+41
View File
@@ -0,0 +1,41 @@
name: Publish Firmware
on:
release:
types: [published]
permissions:
contents: write
jobs:
build-firmware:
name: Build Firmware
uses: esphome/workflows/.github/workflows/build.yml@2024.12.0
with:
#### Modify below here to match your project ####
files: |
athom-2ch-relay-board.yaml
athom-4ch-relay-board.yaml
athom-8ch-relay-board.yaml
athom-energy-monitor-x2.yaml
athom-energy-monitor-x6.yaml
athom-garage-door.yaml
athom-mini-relay-v2.yaml
athom-smart-plug.yaml
athom-zigbee-gateway.yaml
athom-presence-sensor-v3.yaml
esphome-version: 2024.10.3
combined-name: Athom-ESP32-Device
#### Modify above here to match your project ####
release-summary: ${{ github.event.release.body }}
release-url: ${{ github.event.release.html_url }}
release-version: ${{ github.event.release.tag_name }}
upload-to-release:
name: Upload to Release
uses: esphome/workflows/.github/workflows/upload-to-gh-release.yml@2024.12.0
needs:
- build-firmware
with:
version: ${{ github.event.release.tag_name }}
+72
View File
@@ -0,0 +1,72 @@
name: Publish Pages
on:
push:
branches:
- main
paths:
- 'static/**'
- '.github/workflows/publish-pages.yml'
workflow_run:
workflows:
- Publish Firmware
types:
- completed
pull_request:
paths:
- 'static/**'
- '.github/workflows/publish-pages.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4.2.2
- run: mkdir -p output/firmware
- name: Build
uses: actions/jekyll-build-pages@v1.0.13
with:
source: ./static
destination: ./output
- name: Fetch firmware files
uses: robinraju/release-downloader@v1.11
with:
latest: true
fileName: '*'
out-file-path: output/firmware
- name: Upload artifact
uses: actions/upload-pages-artifact@v3.0.1
with:
path: output
retention-days: 1
publish:
if: github.event_name != 'pull_request'
name: Publish
runs-on: ubuntu-latest
needs:
- build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Setup Pages
uses: actions/configure-pages@v5.0.0
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4.0.5
-25
View File
@@ -1,25 +0,0 @@
name: Build and Publish ESPHome firmware and website
on:
push:
branches:
- main
jobs:
build:
uses: esphome/workflows/.github/workflows/publish.yml@main
with:
# CHANGEME: Set the filenames of your config files here:
files:
athom-2ch-relay-board.yaml,
athom-4ch-relay-board.yaml,
athom-8ch-relay-board.yaml,
athom-energy-monitor-x2.yaml,
athom-energy-monitor-x6.yaml,
athom-garage-door.yaml,
athom-mini-relay-v2.yaml,
athom-smart-plug.yaml,
athom-zigbee-gateway.yaml,
athom-presence-sensor-v3.yaml
# CHANGEME: Set the name of your project here:
name: Athom ESP32 Device