1- # Board environment name (lilygo-t-display) must match the [env:] name in platformio.ini
2- # Check with: grep "\[env:" platformio.ini
3-
41name : Build and Release Firmware
52
63on :
74 push :
85 tags :
96 - ' v*'
107
8+ permissions :
9+ contents : write
10+
1111jobs :
1212 build :
1313 runs-on : ubuntu-latest
1414 steps :
15- - uses : actions/checkout@v4
15+ - name : Checkout
16+ uses : actions/checkout@v4
17+ with :
18+ ref : master
19+ token : ${{ secrets.GITHUB_TOKEN }}
1620
1721 - name : Cache PlatformIO
1822 uses : actions/cache@v4
@@ -29,26 +33,61 @@ jobs:
2933 run : pip install platformio esptool
3034
3135 - name : Build firmware
32- run : pio run
36+ run : pio run -e lilygo-t-display
3337
34- - name : Merge binaries into single file
38+ - name : Merge binaries
3539 run : |
36- esptool.py --chip esp32 merge_bin \
40+ esptool --chip esp32 merge-bin \
3741 -o merged-firmware.bin \
38- --flash_mode qout \
39- --flash_freq 80m \
40- --flash_size 4MB \
42+ --flash-mode dio \
43+ --flash-freq 40m \
44+ --flash-size 4MB \
4145 0x1000 .pio/build/lilygo-t-display/bootloader.bin \
4246 0x8000 .pio/build/lilygo-t-display/partitions.bin \
4347 0x10000 .pio/build/lilygo-t-display/firmware.bin
4448
45- - name : Create GitHub Release and upload assets
49+ - name : Copy binaries to website
50+ run : |
51+ mkdir -p website/public/firmware
52+ cp .pio/build/lilygo-t-display/bootloader.bin website/public/firmware/bootloader.bin
53+ cp .pio/build/lilygo-t-display/partitions.bin website/public/firmware/partitions.bin
54+ cp .pio/build/lilygo-t-display/firmware.bin website/public/firmware/firmware.bin
55+ cp merged-firmware.bin website/public/firmware/merged-firmware.bin
56+
57+ - name : Update manifest version
58+ run : |
59+ TAG=${GITHUB_REF#refs/tags/}
60+ cat > website/public/firmware/manifest.json << EOF
61+ {
62+ "name": "SecureGen",
63+ "version": "${TAG}",
64+ "new_install_prompt_erase": true,
65+ "builds": [
66+ {
67+ "chipFamily": "ESP32",
68+ "parts": [
69+ { "path": "bootloader.bin", "offset": 4096 },
70+ { "path": "partitions.bin", "offset": 32768 },
71+ { "path": "firmware.bin", "offset": 65536 }
72+ ]
73+ }
74+ ]
75+ }
76+ EOF
77+
78+ - name : Commit firmware to repo
79+ run : |
80+ git config user.name "github-actions[bot]"
81+ git config user.email "github-actions[bot]@users.noreply.github.com"
82+ git add website/public/firmware/
83+ git commit -m "firmware: update binaries for ${GITHUB_REF#refs/tags/}"
84+ git push origin master
85+
86+ - name : Create GitHub Release
4687 uses : softprops/action-gh-release@v2
4788 with :
4889 files : |
4990 merged-firmware.bin
5091 .pio/build/lilygo-t-display/bootloader.bin
5192 .pio/build/lilygo-t-display/partitions.bin
5293 .pio/build/lilygo-t-display/firmware.bin
53- env :
54- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments