-
-
Notifications
You must be signed in to change notification settings - Fork 25
90 lines (85 loc) · 2.74 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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.12.2
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
with:
path: output
deploy:
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: Checkout repository
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Deploy Firmware to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4