-
Notifications
You must be signed in to change notification settings - Fork 44
187 lines (164 loc) · 7.93 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: Build
on:
push:
branches:
- '**'
tags-ignore:
- '**'
release:
types: [created]
jobs:
build-upload:
runs-on: ubuntu-latest
name: Build
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install ESPHome
run: |
pip3 install wheel
pip3 install esphome
echo "esphome_version=$(esphome version) >> $GITHUB_OUTPUT"
mkdir assets
- id: alarm-panel-esp8266-version
uses: jbutcher5/read-yaml@main
with:
file: './packages/alarm-panel-esp8266-base.yaml'
key-path: '["substitutions", "project_version"]'
- id: alarm-panel-esp32-version
uses: jbutcher5/read-yaml@main
with:
file: './packages/alarm-panel-esp32-base.yaml'
key-path: '["substitutions", "project_version"]'
- id: garage-door-esp8266-version
uses: jbutcher5/read-yaml@main
with:
file: './packages/garage-door-esp8266-base.yaml'
key-path: '["substitutions", "project_version"]'
- id: garage-door-esp32-version
uses: jbutcher5/read-yaml@main
with:
file: './packages/garage-door-esp32-base.yaml'
key-path: '["substitutions", "project_version"]'
- name: Build Alarm Panel ESP8266
id: build-alarm-panel-esp8266
run: |
esphome compile release/alarm-panel-esp8266.yaml
build_path=release/.esphome/build/alarm-panel/.pioenvs/alarm-panel
fname=konnected-esphome-alarm-panel-esp8266-${{ steps.alarm-panel-esp8266-version.outputs.data }}.bin
cp $build_path/firmware-factory.bin assets/$fname
- name: Build Alarm Panel ESP32 (WiFi)
id: build-alarm-panel-pro-esp32-wifi
run: |
esphome compile release/alarm-panel-pro-esp32-wifi.yaml
build_path=release/.esphome/build/alarm-panel-pro/.pioenvs/alarm-panel-pro
fname=konnected-esphome-alarm-panel-esp32-wifi-${{ steps.alarm-panel-esp32-version.outputs.data }}.bin
cp $build_path/firmware-factory.bin assets/$fname
- name: Build Alarm Panel ESP32 (LAN8720)
id: build-alarm-panel-pro-esp32-lan8720
run: |
esphome compile release/alarm-panel-pro-esp32-lan8720.yaml
build_path=release/.esphome/build/alarm-panel-pro/.pioenvs/alarm-panel-pro
fname=konnected-esphome-alarm-panel-esp32-lan8720-${{ steps.alarm-panel-esp32-version.outputs.data }}.bin
cp $build_path/firmware-factory.bin assets/$fname
- name: Build Alarm Panel ESP32 (RTL8201)
id: build-alarm-panel-pro-esp32-rtl8201
run: |
esphome compile release/alarm-panel-pro-esp32-rtl8201.yaml
build_path=release/.esphome/build/alarm-panel-pro/.pioenvs/alarm-panel-pro
fname=konnected-esphome-alarm-panel-esp32-rtl8201-${{ steps.alarm-panel-esp32-version.outputs.data }}.bin
cp $build_path/firmware-factory.bin assets/$fname
- name: Build Garage Door ESP8266
id: build-garage-door-esp8266
run: |
esphome compile release/garage-door-esp8266.yaml
build_path=release/.esphome/build/garage-door/.pioenvs/garage-door
fname=konnected-esphome-garage-door-esp8266-${{ steps.garage-door-esp8266-version.outputs.data }}.bin
cp $build_path/firmware-factory.bin assets/$fname
- name: Build Garage Door ESP32
id: build-garage-door-esp32
run: |
esphome compile release/garage-door-esp32.yaml
build_path=release/.esphome/build/garage-door/.pioenvs/garage-door
fname=konnected-esphome-garage-door-esp32-${{ steps.garage-door-esp32-version.outputs.data }}.bin
cp $build_path/firmware-factory.bin assets/$fname
- uses: keithweaver/[email protected]
name: Upload Builds
with:
command: cp
source: assets/
destination: s3://konnected-io/builds/esphome/
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_region: us-east-2
flags: --recursive --acl public-read
- name: Get release
if: github.event.release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload asset to release
if: github.event.release
uses: bgpat/release-asset-action@03b0c30db1c4031ce3474740b0e4275cd7e126a3
with:
pattern: "assets/*"
release-url: ${{ steps.get_release.outputs.upload_url }}
allow-overwrite: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: mkdir -p install-konnected/manifests
if: github.event.release
- name: Build Manifest for Alarm Panel / WiFi
if: github.event.release
run: |
ruby ./scripts/update-espwebtools-manifests.rb
env:
MANIFEST_NAME: Konnected Alarm Panel for ESPHome (WiFi)
MANIFEST_FNAME: esphome-alarm-panel-wifi.json
MANIFEST_VERSION: "${{ steps.alarm-panel-esp8266-version.outputs.data }} / ${{ steps.alarm-panel-esp32-version.outputs.data }}"
ESP8266_IMAGE_URI: https://konnected-io.s3.us-east-2.amazonaws.com/builds/esphome/konnected-esphome-alarm-panel-esp8266-${{ steps.alarm-panel-esp8266-version.outputs.data }}.bin
ESP32_IMAGE_URI: https://konnected-io.s3.us-east-2.amazonaws.com/builds/esphome/konnected-esphome-alarm-panel-esp32-wifi-${{ steps.alarm-panel-esp32-version.outputs.data }}.bin
- name: Build Manifest for Garage Door
if: github.event.release
run: |
ruby ./scripts/update-espwebtools-manifests.rb
env:
MANIFEST_NAME: Konnected Garage Door for ESPHome (WiFi)
MANIFEST_FNAME: esphome-garage-door-wifi.json
MANIFEST_VERSION: "${{ steps.garage-door-esp8266-version.outputs.data }}"
ESP8266_IMAGE_URI: https://konnected-io.s3.us-east-2.amazonaws.com/builds/esphome/konnected-esphome-garage-door-esp8266-${{ steps.garage-door-esp8266-version.outputs.data }}.bin
ESP32_IMAGE_URI: https://konnected-io.s3.us-east-2.amazonaws.com/builds/esphome/konnected-esphome-garage-door-esp32-${{ steps.garage-door-esp32-version.outputs.data }}.bin
- name: Build Manifest for Alarm Panel / LAN8720
if: github.event.release
run: |
ruby ./scripts/update-espwebtools-manifests.rb
env:
MANIFEST_NAME: Konnected Alarm Panel for ESPHome (LAN8720)
MANIFEST_FNAME: esphome-alarm-panel-lan8720.json
MANIFEST_VERSION: "${{ steps.alarm-panel-esp32-version.outputs.data }}"
ESP32_IMAGE_URI: https://konnected-io.s3.us-east-2.amazonaws.com/builds/esphome/konnected-esphome-alarm-panel-esp32-lan8720-${{ steps.alarm-panel-esp32-version.outputs.data }}.bin
- name: Build Manifest for Alarm Panel / RTL8201
if: github.event.release
run: |
ruby ./scripts/update-espwebtools-manifests.rb
env:
MANIFEST_NAME: Konnected Alarm Panel for ESPHome (RTL8201)
MANIFEST_FNAME: esphome-alarm-panel-rtl8201.json
MANIFEST_VERSION: "${{ steps.alarm-panel-esp32-version.outputs.data }}"
ESP32_IMAGE_URI: https://konnected-io.s3.us-east-2.amazonaws.com/builds/esphome/konnected-esphome-alarm-panel-esp32-rtl8201-${{ steps.alarm-panel-esp32-version.outputs.data }}.bin
- name: Deploy
if: github.event.release
uses: reggionick/s3-deploy@v4
with:
folder: install-konnected
bucket: install-konnected
bucket-region: us-east-1
dist-id: E2FDL2RANMI9J7
invalidation: /manifests/*