-
-
Notifications
You must be signed in to change notification settings - Fork 90
184 lines (172 loc) · 16 KB
/
release.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
name: Build firmware and release
on:
workflow_dispatch:
inputs:
tag:
description: "Firmare version (Tag)"
required: true
default: '*.*.*'
jobs:
release:
runs-on: ubuntu-latest
env:
TMPDIR: /tmp
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install platformio
- name: Run PlatformIO build on selected platforms
run: |
pio run -e esp32doit-devkit-v1 -e ttgo-t-eight -e ttgo-t-display -e lilygo-t-display -e heltec_wifi_kit_32 -e esp-wrover-kit -e bpi-leaf-s3 -e lilygo-t-display-s3
pio run -t buildfs -e esp32doit-devkit-v1 -e ttgo-t-eight -e ttgo-t-display -e lilygo-t-display -e heltec_wifi_kit_32 -e esp-wrover-kit -e bpi-leaf-s3 -e lilygo-t-display-s3
- name: Copy binary files
run: |
rm -rf ./firmware/esp32doit-devkit-v1/*
echo ${{ github.event.inputs.tag }} > ./firmware/esp32doit-devkit-v1/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32 merge_bin \
-o ./firmware/esp32doit-devkit-v1/esp32doit-devkit-v1-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x1000 ~/.platformio/packages/[email protected]/tools/sdk/bin/bootloader_dio_80m.bin \
0x8000 /tmp/PedalinoMini/build/esp32doit-devkit-v1/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/esp32doit-devkit-v1/firmware.bin \
0x3c0000 /tmp/PedalinoMini/build/esp32doit-devkit-v1/spiffs.bin
cp ./manifest/template_esp32.json ./firmware/esp32doit-devkit-v1/esp32doit-devkit-v1-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/esp32doit-devkit-v1/esp32doit-devkit-v1-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/esp32doit-devkit-v1/g' ./firmware/esp32doit-devkit-v1/esp32doit-devkit-v1-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/esp32doit-devkit-v1/firmware.bin | head -c 32 > ./firmware/esp32doit-devkit-v1/firmware.bin.md5
rm -rf ./firmware/ttgo-t-eight/*
echo ${{ github.event.inputs.tag }} > ./firmware/ttgo-t-eight/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32 merge_bin \
-o ./firmware/ttgo-t-eight/ttgo-t-eight-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x1000 ~/.platformio/packages/[email protected]/tools/sdk/bin/bootloader_dio_80m.bin \
0x8000 /tmp/PedalinoMini/build/ttgo-t-eight/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/ttgo-t-eight/firmware.bin \
0x3c0000 /tmp/PedalinoMini/build/ttgo-t-eight/spiffs.bin
cp ./manifest/template_esp32.json ./firmware/ttgo-t-eight/ttgo-t-eight-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/ttgo-t-eight/ttgo-t-eight-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/ttgo-t-eight/g' ./firmware/ttgo-t-eight/ttgo-t-eight-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/ttgo-t-eight/firmware.bin | head -c 32 > ./firmware/ttgo-t-eight/firmware.bin.md5
rm -rf ./firmware/ttgo-t-display/*
echo ${{ github.event.inputs.tag }} > ./firmware/ttgo-t-display/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32 merge_bin \
-o ./firmware/ttgo-t-display/ttgo-t-display-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x1000 ~/.platformio/packages/[email protected]/tools/sdk/bin/bootloader_dio_80m.bin \
0x8000 /tmp/PedalinoMini/build/ttgo-t-display/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/ttgo-t-display/firmware.bin \
0x3c0000 /tmp/PedalinoMini/build/ttgo-t-display/spiffs.bin
cp ./manifest/template_esp32.json ./firmware/ttgo-t-display/ttgo-t-display-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/ttgo-t-display/ttgo-t-display-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/ttgo-t-display/g' ./firmware/ttgo-t-display/ttgo-t-display-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/ttgo-t-display/firmware.bin | head -c 32 > ./firmware/ttgo-t-display/firmware.bin.md5
rm -rf ./firmware/lilygo-t-display/*
echo ${{ github.event.inputs.tag }} > ./firmware/lilygo-t-display/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32 merge_bin \
-o ./firmware/lilygo-t-display/lilygo-t-display-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x1000 ~/.platformio/packages/[email protected]/tools/sdk/bin/bootloader_dio_80m.bin \
0x8000 /tmp/PedalinoMini/build/lilygo-t-display/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/lilygo-t-display/firmware.bin \
0x3c0000 /tmp/PedalinoMini/build/lilygo-t-display/spiffs.bin
cp ./manifest/template_esp32.json ./firmware/lilygo-t-display/lilygo-t-display-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/lilygo-t-display/lilygo-t-display-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/lilygo-t-display/g' ./firmware/lilygo-t-display/lilygo-t-display-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/lilygo-t-display/firmware.bin | head -c 32 > ./firmware/lilygo-t-display/firmware.bin.md5
rm -rf ./firmware/heltec_wifi_kit_32/*
echo ${{ github.event.inputs.tag }} > ./firmware/heltec_wifi_kit_32/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32 merge_bin \
-o ./firmware/heltec_wifi_kit_32/heltec_wifi_kit_32-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x1000 ~/.platformio/packages/[email protected]/tools/sdk/bin/bootloader_dio_80m.bin \
0x8000 /tmp/PedalinoMini/build/heltec_wifi_kit_32/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/heltec_wifi_kit_32/firmware.bin \
0x3c0000 /tmp/PedalinoMini/build/heltec_wifi_kit_32/spiffs.bin
cp ./manifest/template_esp32.json ./firmware/heltec_wifi_kit_32/heltec_wifi_kit_32-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/heltec_wifi_kit_32/heltec_wifi_kit_32-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/heltec_wifi_kit_32/g' ./firmware/heltec_wifi_kit_32/heltec_wifi_kit_32-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/heltec_wifi_kit_32/firmware.bin | head -c 32 > ./firmware/heltec_wifi_kit_32/firmware.bin.md5
rm -rf ./firmware/esp-wrover-kit/*
echo ${{ github.event.inputs.tag }} > ./firmware/esp-wrover-kit/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32 merge_bin \
-o ./firmware/esp-wrover-kit/esp-wrover-kit-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 4MB \
0x1000 ~/.platformio/packages/[email protected]/tools/sdk/bin/bootloader_dio_80m.bin \
0x8000 /tmp/PedalinoMini/build/esp-wrover-kit/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/esp-wrover-kit/firmware.bin \
0x3c0000 /tmp/PedalinoMini/build/esp-wrover-kit/spiffs.bin
cp ./manifest/template_esp32.json ./firmware/esp-wrover-kit/esp-wrover-kit-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/esp-wrover-kit/esp-wrover-kit-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/esp-wrover-kit/g' ./firmware/esp-wrover-kit/esp-wrover-kit-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/esp-wrover-kit/firmware.bin | head -c 32 > ./firmware/esp-wrover-kit/firmware.bin.md5
rm -rf ./firmware/bpi-leaf-s3/*
echo ${{ github.event.inputs.tag }} > ./firmware/bpi-leaf-s3/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32s3 merge_bin \
-o ./firmware/bpi-leaf-s3/bpi-leaf-s3-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 8MB \
0x0000 /tmp/PedalinoMini/build/bpi-leaf-s3/bootloader.bin \
0x8000 /tmp/PedalinoMini/build/bpi-leaf-s3/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/bpi-leaf-s3/firmware.bin \
0x6e0000 /tmp/PedalinoMini/build/bpi-leaf-s3/spiffs.bin
cp ./manifest/template_esp32s3.json ./firmware/bpi-leaf-s3/bpi-leaf-s3-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/bpi-leaf-s3/bpi-leaf-s3-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/bpi-leaf-s3/g' ./firmware/bpi-leaf-s3/bpi-leaf-s3-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/bpi-leaf-s3/firmware.bin | head -c 32 > ./firmware/bpi-leaf-s3/firmware.bin.md5
rm -rf ./firmware/lilygo-t-display-s3/*
echo ${{ github.event.inputs.tag }} > ./firmware/lilygo-t-display-s3/version.txt
python ~/.platformio/packages/tool-esptoolpy/esptool.py --chip esp32s3 merge_bin \
-o ./firmware/lilygo-t-display-s3/lilygo-t-display-s3-${{ github.event.inputs.tag }}-firmware.bin \
--flash_mode dio \
--flash_freq 80m \
--flash_size 16MB \
0x0000 /tmp/PedalinoMini/build/lilygo-t-display-s3/bootloader.bin \
0x8000 /tmp/PedalinoMini/build/lilygo-t-display-s3/partitions.bin \
0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin \
0x10000 /tmp/PedalinoMini/build/lilygo-t-display-s3/firmware.bin \
0x6e0000 /tmp/PedalinoMini/build/lilygo-t-display-s3/spiffs.bin
cp ./manifest/template_esp32s3.json ./firmware/lilygo-t-display-s3/lilygo-t-display-s3-${{ github.event.inputs.tag }}.json
sed -i 's/x.y.z/${{ github.event.inputs.tag }}/g' ./firmware/lilygo-t-display-s3/lilygo-t-display-s3-${{ github.event.inputs.tag }}.json
sed -i 's/xxx/lilygo-t-display-s3/g' ./firmware/lilygo-t-display-s3/lilygo-t-display-s3-${{ github.event.inputs.tag }}.json
md5sum /tmp/PedalinoMini/build/lilygo-t-display-s3/firmware.bin | head -c 32 > ./firmware/lilygo-t-display-s3/firmware.bin.md5
- name: Commit and push firmware ${{ github.event.inputs.tag }} files
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Release firmware ${{ github.event.inputs.tag }}"
git push origin HEAD:master
git tag ${{ github.event.inputs.tag }}
git push --tags
- name: Create release ${{ github.event.inputs.tag }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}