Skip to content

Merge pull request #230 from huizebruin/jesserockz-2024-448 #283

Merge pull request #230 from huizebruin/jesserockz-2024-448

Merge pull request #230 from huizebruin/jesserockz-2024-448 #283

Workflow file for this run

name: Build
# Build the ESPHome firmwares for the S0tool project.
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
release:
types: [published]
jobs:
build:
name: Build firmware 🛠️
uses: esphome/workflows/.github/workflows/build.yml@main
with:
files: |
esphome/watermeter.yaml
esphome/pulscounter.yaml
esphome/S0-puls-kwhpuls.yaml
esphome/S0-puls-DSZ12D.yaml
esphome/S0-puls-LEM022SJ.yaml
esphome/s0-watermeter.yaml
esphome/wsz15d32a.yaml
esphome/sdm72d.yaml
esphome/puls-water-internal.yaml
esphome/kwh-water-test.yaml
esphome/pulscounter_flux.yaml
esphome-version: 2024.7.3
release-summary: ${{ github.event_name == 'release' && github.event.release.body || '' }}
release-url: ${{ github.event_name == 'release' && github.event.release.html_url || '' }}
release-version: ${{ github.event_name == 'release' && github.event.release.tag_name || '' }}
consolidate:
name: Consolidate firmwares 🚀
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Download built firmwares
uses: actions/download-artifact@v4
with:
path: firmwares
- name: Remove intermediate version folder
run: |-
for d in firmwares/*/*; do
if [ -d "$d" ]; then
mv $d/* $d/../
rm -rf $d
fi
done
- name: Copy files
run: |-
mkdir output
cp -R static/* output/
cp -R firmwares/* output/
- name: Copy manifest files to root and modify paths # This is required so that older firmwares can update to newer firmwares with new manifest paths
run: |-
for device in firmwares/*; do
device=$(basename $device)
jq --arg device "$device" \
'.builds[].ota.path |= $device + "/" + . | (.builds[].parts // [])[].path |= $device + "/" + .' \
firmwares/$device/manifest.json > output/$device-manifest.json
done
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3.0.1
with:
path: output
deploy:
if: github.event_name == 'release'
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@v5
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4.0.5