Trigger action when prebuilt yaml changes
This commit is contained in:
3
.github/workflows/validate_esphome.yml
vendored
3
.github/workflows/validate_esphome.yml
vendored
@@ -7,11 +7,13 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- "nspanel_esphome*.yaml"
|
- "nspanel_esphome*.yaml"
|
||||||
- "esphome/nspanel_esphome*.yaml"
|
- "esphome/nspanel_esphome*.yaml"
|
||||||
|
- "prebuilt/nspanel_esphome*.yaml"
|
||||||
- ".test/*.yaml"
|
- ".test/*.yaml"
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- "nspanel_esphome*.yaml"
|
- "nspanel_esphome*.yaml"
|
||||||
- "esphome/nspanel_esphome*.yaml"
|
- "esphome/nspanel_esphome*.yaml"
|
||||||
|
- "prebuilt/nspanel_esphome*.yaml"
|
||||||
- ".test/*.yaml"
|
- ".test/*.yaml"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@@ -193,7 +195,6 @@ jobs:
|
|||||||
uses: barndawgie/build-action@v1.9.0
|
uses: barndawgie/build-action@v1.9.0
|
||||||
with:
|
with:
|
||||||
yaml_file: prebuilt/nspanel_esphome_prebuilt.yaml
|
yaml_file: prebuilt/nspanel_esphome_prebuilt.yaml
|
||||||
version: latest
|
|
||||||
|
|
||||||
- name: Move and Rename Firmware File
|
- name: Move and Rename Firmware File
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
43
.github/workflows/validate_esphome_beta.yml
vendored
43
.github/workflows/validate_esphome_beta.yml
vendored
@@ -178,4 +178,47 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
yaml_file: "./.test/esphome_advanced_climate_heat_customizations.yaml"
|
yaml_file: "./.test/esphome_advanced_climate_heat_customizations.yaml"
|
||||||
version: beta
|
version: beta
|
||||||
|
|
||||||
|
build_prebuilt_firmware:
|
||||||
|
name: Prebuilt Firmware
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build_core # Ensure this job runs after the core build job
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4.1.0
|
||||||
|
with:
|
||||||
|
fetch-depth: '0'
|
||||||
|
|
||||||
|
- name: Build ESPHome Prebuilt Firmware
|
||||||
|
uses: barndawgie/build-action@v1.9.0
|
||||||
|
with:
|
||||||
|
yaml_file: prebuilt/nspanel_esphome_prebuilt.yaml
|
||||||
|
version: beta
|
||||||
|
|
||||||
|
- name: Move and Rename Firmware File
|
||||||
|
run: |
|
||||||
|
mkdir -p prebuilt
|
||||||
|
cp prebuilt/.esphome/build/nspanel/.pioenvs/nspanel/firmware.bin prebuilt/nspanel_esphome_prebuilt.bin || true
|
||||||
|
cp prebuilt/.esphome/build/nspanel/.pioenvs/nspanel/firmware-factory.bin prebuilt/nspanel_esphome_prebuilt-factory.bin || true
|
||||||
|
|
||||||
|
- name: Set Commit Message
|
||||||
|
id: set_commit_message
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||||
|
echo "COMMIT_MESSAGE=Pre-built firmware for NSPanel - ${{ github.event.pull_request.title }}" >> $GITHUB_ENV
|
||||||
|
elif [[ "${{ github.event_name }}" == "push" ]]; then
|
||||||
|
commit_message=$(git log -1 --pretty=format:'%s')
|
||||||
|
echo "COMMIT_MESSAGE=Pre-built firmware for NSPanel - $commit_message" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "COMMIT_MESSAGE=Pre-built firmware for NSPanel" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Commit and Push Firmware Files
|
||||||
|
run: |
|
||||||
|
git config --global user.name 'GitHub Actions'
|
||||||
|
git config --global user.email 'actions@github.com'
|
||||||
|
git add prebuilt/*.bin
|
||||||
|
git commit -m "${{ env.COMMIT_MESSAGE }}"
|
||||||
|
git push
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
...
|
...
|
||||||
|
|||||||
Reference in New Issue
Block a user