-
Notifications
You must be signed in to change notification settings - Fork 12
89 lines (83 loc) · 2.53 KB
/
main.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
name: Build
on:
push:
branches:
- main
workflow_dispatch:
pull_request:
schedule:
- cron: "0 5 * * 1"
concurrency:
# yamllint disable-line rule:line-length
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build firmware
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: esphome/build-action@v1.8.0
id: esphome-build
with:
yaml_file: example/mr24hpc1.yaml
version: latest
- name: Move generated files to output
run: |
mkdir -p output
mv ${{ steps.esphome-build.outputs.name }} output/
mv output/${{ steps.esphome-build.outputs.name }}/manifest.json output/
echo ${{ steps.esphome-build.outputs.version }} > output/version
- uses: actions/upload-artifact@v3.1.3
with:
name: seeedstudio-mmwave-kit-esp32c3
path: output
manifest:
name: Create full manifest
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v3
with:
name: seeedstudio-mmwave-kit-esp32c3
path: files
- name: Generate manifest.json files
run: |
cd files
mkdir ../output
version=$(cat version)
jq --arg version "$version" '{"name": "Seeed Studio mmWave Kit", "version": $version, "home_assistant_domain": "esphome", "new_install_skip_erase": false, "builds":[.]}' manifest.json > ../output/manifest.json
- uses: actions/upload-artifact@v3.1.3
with:
name: seeedstudio-mmwave-kit-esp32c3
path: output
consolidate:
name: Consolidate firmwares
runs-on: ubuntu-latest
needs: manifest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
path: output
- run: cp -R static/* output/
- uses: actions/upload-pages-artifact@v2.0.0
with:
path: output
deploy:
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main'
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@v3
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2.0.4