-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (57 loc) · 2.17 KB
/
compile-sketches-platformio.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
name: PlatformIO CI
on:
push:
branches: [main]
tags: ["v*.*.*"]
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Build PlatformIO Project
run: pio run -d senseBox-bike-atrai-v2
- name: Create OTA update file
run: |
git clone https://github.com/arduino-libraries/ArduinoIoTCloud.git
pip install crccheck
cd ArduinoIoTCloud/extras/tools
python3 lzss.py --encode ${{ github.workspace }}/senseBox-bike-atrai-v2/.pio/build/sensebox_mcu_esp32s2/firmware.bin ${{ runner.temp }}/firmware.bin.lzss
python3 bin2ota.py ESP32 ${{ runner.temp }}/firmware.bin.lzss ${{ runner.temp }}/firmware.ota
mkdir -p ${{ github.workspace }}/senseBox-bike-atrai-v2/build/sensebox_mcu_esp32s2
mv ${{ runner.temp }}/firmware.ota ${{ github.workspace }}/senseBox-bike-atrai-v2/build/sensebox_mcu_esp32s2/senseBox-bike-atrai-v2.bin.ota
mv ${{ github.workspace }}/senseBox-bike-atrai-v2/.pio/build/sensebox_mcu_esp32s2/firmware.bin ${{ github.workspace }}/senseBox-bike-atrai-v2/build/sensebox_mcu_esp32s2/senseBox-bike-atrai-v2.bin
- name: Export binaries as artifacts
uses: actions/upload-artifact@v4
with:
name: senseBox-bike-atrai-v2-artifacts
path: ${{ github.workspace }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Firmware Files
uses: actions/download-artifact@v4
with:
path: release
- name: Release Firmware
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/')
with:
artifacts: "release/**/*.bin, release/**/*.ota"
allowUpdates: true
omitBodyDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}