11name : Build binaries, docs and publish to dev folder
2+
23on :
34 workflow_dispatch :
45 schedule :
56 - cron : ' 0 0 * * *'
7+
68jobs :
7- build :
8- strategy :
9- fail-fast : false
10- matrix :
11- environments :
12- - " rfbridge"
13- - " rfbridge-direct"
14- - " theengs-bridge"
15- - " theengs-bridge-v11"
16- - " theengs-plug"
17- - " esp32dev-all-test"
18- - " esp32dev-rf"
19- - " esp32dev-pilight"
20- - " esp32dev-pilight-cc1101"
21- - " esp32dev-somfy-cc1101"
22- - " esp32dev-pilight-somfy-cc1101"
23- - " esp32dev-weatherstation"
24- - " esp32dev-gf-sun-inverter"
25- - " esp32dev-ir"
26- - " esp32dev-ble"
27- - " esp32dev-ble-broker"
28- - " esp32dev-ble-mqtt-undecoded"
29- - " esp32dev-ble-aws"
30- - " esp32feather-ble"
31- - " esp32-lolin32lite-ble"
32- - " esp32-olimex-gtw-ble-eth"
33- - " esp32-olimex-gtw-ble-poe"
34- - " esp32-olimex-gtw-ble-poe-iso"
35- - " esp32-wt32-eth01-ble-eth"
36- - " esp32-olimex-gtw-ble-wifi"
37- - " esp32-m5stick-ble"
38- - " esp32-m5stack-ble"
39- - " esp32-m5tough-ble"
40- - " esp32-m5stick-c-ble"
41- - " esp32-m5stick-cp-ble"
42- - " esp32-m5atom-matrix"
43- - " esp32-m5atom-lite"
44- - " esp32doitv1-aithinker-r01-sx1278"
45- - " esp32dev-rtl_433"
46- - " esp32dev-rtl_433-fsk"
47- - " heltec-rtl_433"
48- - " heltec-rtl_433-fsk"
49- - " heltec-ble"
50- - " lilygo-rtl_433"
51- - " lilygo-rtl_433-fsk"
52- - " lilygo-t3-s3-rtl_433"
53- - " lilygo-t3-s3-rtl_433-fsk"
54- - " lilygo-ble"
55- - " esp32dev-multi_receiver"
56- - " esp32dev-multi_receiver-pilight"
57- - " tinypico-ble"
58- - " ttgo-lora32-v1"
59- - " ttgo-lora32-v21"
60- - " ttgo-t-beam"
61- - " heltec-wifi-lora-32"
62- - " shelly-plus1"
63- - " nodemcuv2-all-test"
64- - " nodemcuv2-fastled-test"
65- - " nodemcuv2-2g"
66- - " nodemcuv2-ir"
67- - " nodemcuv2-serial"
68- - " avatto-bakeey-ir"
69- - " nodemcuv2-rf"
70- - " nodemcuv2-rf-cc1101"
71- - " nodemcuv2-somfy-cc1101"
72- - " manual-wifi-test"
73- - " rf-wifi-gateway"
74- - " nodemcuv2-rf2"
75- - " nodemcuv2-rf2-cc1101"
76- - " nodemcuv2-pilight"
77- - " nodemcuv2-weatherstation"
78- - " sonoff-basic"
79- - " sonoff-basic-rfr3"
80- - " esp32dev-ble-datatest"
81- - " esp32s3-dev-c1-ble"
82- - " esp32s3-m5stack-stamps3"
83- - " esp32s3-atomS3U"
84- - " esp32c3-dev-m1-ble"
85- - " airm2m_core_esp32c3"
86- - " esp32c3-dev-c2-ble"
87- - " esp32c3-dev-c2-ble-no-serial"
88- - " esp32c3_lolin_mini"
89- - " esp32c3_lolin_mini_with_serial"
90- - " esp32c3-m5stamp"
91- - " esp32c3u-m5stamp"
92- - " thingpulse-espgateway"
93- - " esp32dev-ble-idf"
9+ prepare :
9410 runs-on : ubuntu-latest
9511 if : github.repository_owner == '1technophile'
96- name : Build ${{ matrix.environments }}
12+ outputs :
13+ short-sha : ${{ steps.short-sha.outputs.sha }}
9714 steps :
9815 - uses : actions/checkout@v4
9916 - uses : benjlevesque/short-sha@v2.1
10017 id : short-sha
10118 with :
10219 length : 6
103- - name : Set up Python
104- uses : actions/setup-python@v5
105- with :
106- python-version : " 3.13"
107- - name : Install uv
108- uses : astral-sh/setup-uv@v6
109- with :
110- version : " latest"
111- enable-cache : false
112- - name : Install dependencies
113- run : |
114- uv pip install --system -U https://github.com/pioarduino/platformio-core/archive/refs/tags/v6.1.18.zip
115- - name : Set sha tag
116- run : |
117- sed -i "s/version_tag/${{ steps.short-sha.outputs.sha }}/g" main/User_config.h scripts/latest_version_dev.json
118- - name : Run PlatformIO
119- env :
120- PYTHONIOENCODING : utf-8
121- PYTHONUTF8 : ' 1'
122- run : |
123- export PLATFORMIO_BUILD_FLAGS="'-DDEVELOPMENTOTA=true'"
124- platformio run -e ${{ matrix.environments }}
125- - name : Prepare firmware artifacts
126- run : |
127- mkdir -p firmware
128- cp .pio/build/${{ matrix.environments }}/firmware.bin firmware/${{ matrix.environments }}-firmware.bin
129- if [ -f .pio/build/${{ matrix.environments }}/partitions.bin ]; then
130- cp .pio/build/${{ matrix.environments }}/partitions.bin firmware/${{ matrix.environments }}-partitions.bin
131- fi
132- if [ -f .pio/build/${{ matrix.environments }}/bootloader.bin ]; then
133- cp .pio/build/${{ matrix.environments }}/bootloader.bin firmware/${{ matrix.environments }}-bootloader.bin
134- fi
135- - name : Upload firmware
136- uses : actions/upload-artifact@v4
137- with :
138- name : firmware-${{ matrix.environments }}
139- path : firmware/
140- retention-days : 1
20+
21+ build :
22+ needs : prepare
23+ name : Build development firmware
24+ uses : ./.github/workflows/task-build.yml
25+ with :
26+ python-version : ' 3.13'
27+ enable-dev-ota : true
28+ version-tag : ${{ needs.prepare.outputs.short-sha }}
29+ artifact-retention-days : 1
30+ artifact-name-prefix : ' firmware-'
31+ prepare-for-deploy : true
14132
14233 deploy :
143- needs : build
34+ needs : [prepare, build]
14435 runs-on : ubuntu-latest
14536 if : github.repository_owner == '1technophile'
14637 name : Deploy binaries and docs
14738 steps :
14839 - uses : actions/checkout@v4
149- - uses : benjlevesque/short-sha@v2.1
150- id : short-sha
151- with :
152- length : 6
40+
15341 - name : Download all firmware artifacts
15442 uses : actions/download-artifact@v4
15543 with :
15644 pattern : firmware-*
15745 path : toDeploy
15846 merge-multiple : true
47+
15948 - name : Set up Python
16049 uses : actions/setup-python@v5
16150 with :
16251 python-version : " 3.13"
52+
16353 - name : Install uv
16454 uses : astral-sh/setup-uv@v6
16555 with :
16656 version : " latest"
16757 enable-cache : false
58+
16859 - name : Install dependencies
16960 run : |
17061 uv pip install --system -U https://github.com/pioarduino/platformio-core/archive/refs/tags/v6.1.18.zip
62+
17163 - name : Create library zips
17264 run : |
17365 # Install libraries for a representative environment to get libdeps
18072 zip -r "${i%/}-libraries.zip" "$i"
18173 done
18274 mv *.zip ../../toDeploy/
75+
18376 - name : Prepare additional assets
18477 run : |
18578 cd toDeploy
@@ -189,33 +82,22 @@ jobs:
18982 # Zip source code
19083 zip -r toDeploy/OpenMQTTGateway_sources.zip main LICENSE.txt
19184 ls -lA toDeploy/
192- - name : Set sha tag for docs
193- run : |
194- sed -i "s/version_tag/DEVELOPMENT SHA:${{ steps.short-sha.outputs.sha }} TEST ONLY/g" docs/.vuepress/config.js
195- sed -i "s|base: '/'|base: '/dev/'|g" docs/.vuepress/config.js
196- - name : Set up Node.js
197- uses : actions/setup-node@v4
198- with :
199- node-version : " 16.x"
200- - name : Download Common Config
201- run : |
202- curl -o docs/.vuepress/public/commonConfig.js https://www.theengs.io/commonConfig.js
203- - name : Build documentation
204- run : |
205- python ./scripts/gen_wu.py --dev
206- npm install
207- npm run docs:build
208- - name : Deploy to GitHub Pages
209- uses : peaceiris/actions-gh-pages@v3
210- with :
211- github_token : ${{ secrets.GITHUB_TOKEN }}
212- publish_dir : ./docs/.vuepress/dist
213- destination_dir : dev
214- cname : docs.openmqttgateway.com
215- - name : Running Page Speed Insights
216- uses : jakepartusch/psi-action@v1.3
217- id : psi
218- with :
219- url : " https://docs.openmqttgateway.com/dev/"
220- threshold : 60
221- key : ${{ secrets.APIKEY }}
85+
86+ documentation :
87+ needs : [prepare, build]
88+ name : Build and deploy development documentation
89+ uses : ./.github/workflows/task-docs.yml
90+ with :
91+ python-version : ' 3.11'
92+ node-version : ' 16.x'
93+ version-source : ' custom'
94+ custom-version : ' DEVELOPMENT SHA:${{ needs.prepare.outputs.short-sha }} TEST ONLY'
95+ base-path : ' /dev/'
96+ destination-dir : ' dev'
97+ generate-webuploader : true
98+ webuploader-args : ' --dev'
99+ run-pagespeed : true
100+ pagespeed-url : ' https://docs.openmqttgateway.com/dev/'
101+ secrets :
102+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
103+ APIKEY : ${{ secrets.APIKEY }}
0 commit comments