Skip to content

Commit bb2ae15

Browse files
committed
.github/workflows: Add PowerHub.
Signed-off-by: lbuque <[email protected]>
1 parent cb5bdaf commit bb2ae15

File tree

4 files changed

+180
-417
lines changed

4 files changed

+180
-417
lines changed
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
name: Build Firmware (Reusable)
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
upload_artifacts:
7+
description: 'Whether to upload artifacts'
8+
required: false
9+
type: boolean
10+
default: true
11+
upload_release:
12+
description: 'Whether to upload to release'
13+
required: false
14+
type: boolean
15+
default: false
16+
17+
jobs:
18+
setup:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
cache-hit: ${{ steps.cache-esp-idf.outputs.cache-hit }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Install dependencies
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y git wget flex bison gperf quilt python3 python3-pip \
29+
python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
30+
31+
- name: Cache esp-idf
32+
uses: actions/cache@v4
33+
id: cache-esp-idf
34+
with:
35+
path: |
36+
~/.espressif
37+
${{ github.workspace }}/esp-idf
38+
key: ${{ runner.os }}-idf-v5.4.2
39+
40+
- name: Install ESP-IDF
41+
if: steps.cache-esp-idf.outputs.cache-hit != 'true'
42+
run: |
43+
git clone --depth=1 -b $IDF_VERSION https://github.com/espressif/esp-idf.git
44+
./esp-idf/install.sh
45+
env:
46+
IDF_VERSION: "v5.4.2"
47+
48+
- name: Setup environment
49+
run: |
50+
source tools/ci.sh && ci_esp32_idf542_setup
51+
source esp-idf/export.sh
52+
pip install future
53+
make -C m5stack submodules
54+
make -C m5stack patch
55+
make -C m5stack littlefs
56+
57+
build:
58+
needs: setup
59+
runs-on: ubuntu-latest
60+
strategy:
61+
matrix:
62+
board:
63+
- M5STACK_AirQ
64+
- M5STACK_Atom_Echo
65+
- M5STACK_Atom_EchoS3R
66+
- M5STACK_Atom_Lite
67+
- M5STACK_Atom_Matrix
68+
- M5STACK_AtomS3
69+
- M5STACK_AtomS3_Lite
70+
- M5STACK_AtomS3R
71+
- M5STACK_AtomS3R_CAM
72+
- M5STACK_AtomS3U
73+
- M5STACK_AtomU
74+
- M5STACK_Basic
75+
- M5STACK_Basic_4MB
76+
- M5STACK_Capsule
77+
- M5STACK_Cardputer
78+
- M5STACK_CardputerADV
79+
- M5STACK_Core2
80+
- M5STACK_CoreInk
81+
- M5STACK_CoreS3
82+
- M5STACK_Dial
83+
- M5STACK_DinMeter
84+
- M5STACK_Fire
85+
- M5STACK_NanoC6
86+
- M5STACK_Paper
87+
- M5STACK_PaperS3
88+
- M5STACK_PowerHub
89+
- M5STACK_Stamp_PICO
90+
- M5STACK_StamPLC
91+
- M5STACK_StampS3
92+
- M5STACK_Station
93+
- M5STACK_StickC
94+
- M5STACK_StickC_PLUS
95+
- M5STACK_StickC_PLUS2
96+
- M5STACK_Tab5
97+
- M5STACK_Tough
98+
- M5STACK_Unit_C6L
99+
- Nesso_N1
100+
- ESPRESSIF_ESP32_S3_BOX_3
101+
- SEEED_STUDIO_XIAO_ESP32S3
102+
max-parallel: 4
103+
steps:
104+
- uses: actions/checkout@v4
105+
106+
- name: Install dependencies
107+
run: |
108+
sudo apt-get update
109+
sudo apt-get install -y git wget flex bison gperf quilt python3 python3-pip \
110+
python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
111+
112+
- name: Restore ESP-IDF cache
113+
uses: actions/cache@v4
114+
with:
115+
path: |
116+
~/.espressif
117+
${{ github.workspace }}/esp-idf
118+
key: ${{ runner.os }}-idf-v5.4.2
119+
120+
- name: Prepare environment
121+
run: |
122+
source esp-idf/export.sh
123+
124+
- name: Build M5Stack ${{ matrix.board }}
125+
if: startsWith(matrix.board, 'M5STACK')
126+
run: |
127+
source esp-idf/export.sh
128+
pip install future
129+
make -C m5stack submodules
130+
make -C m5stack patch
131+
make -C m5stack littlefs
132+
make -C m5stack BOARD=${{ matrix.board }} pack_all
133+
134+
- name: Build third-party ${{ matrix.board }}
135+
if: "!startsWith(matrix.board, 'M5STACK')"
136+
run: |
137+
source esp-idf/export.sh
138+
pip install future
139+
make -C m5stack submodules
140+
make -C m5stack patch
141+
make -C m5stack littlefs
142+
make -C third-party BOARD=${{ matrix.board }} pack_all
143+
144+
- name: Upload M5Stack firmware artifact
145+
if: inputs.upload_artifacts && startsWith(matrix.board, 'M5STACK')
146+
uses: actions/upload-artifact@v4
147+
with:
148+
name: firmware-${{ matrix.board }}
149+
path: m5stack/build-${{ matrix.board }}/uiflow-*-*.bin
150+
151+
- name: Upload third-party firmware artifact
152+
if: inputs.upload_artifacts && !startsWith(matrix.board, 'M5STACK')
153+
uses: actions/upload-artifact@v4
154+
with:
155+
name: firmware-${{ matrix.board }}
156+
path: third-party/build-${{ matrix.board }}/uiflow-*-*.bin
157+
158+
- name: Upload firmware to release
159+
uses: softprops/action-gh-release@v2
160+
if: inputs.upload_release && startsWith(github.ref, 'refs/tags/')
161+
env:
162+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
163+
with:
164+
files: |
165+
${{ startsWith(matrix.board, 'M5STACK') && 'm5stack' || 'third-party' }}/build-${{ matrix.board }}/uiflow-*-*.bin

.github/workflows/build-release.yml

Lines changed: 5 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -11,144 +11,8 @@ permissions:
1111
packages: write
1212

1313
jobs:
14-
setup:
15-
runs-on: ubuntu-latest
16-
outputs:
17-
cache-hit: ${{ steps.cache-esp-idf.outputs.cache-hit }}
18-
steps:
19-
- uses: actions/checkout@v4
20-
21-
- name: Install dependencies
22-
run: |
23-
sudo apt-get update
24-
sudo apt-get install -y git wget flex bison gperf quilt python3 python3-pip \
25-
python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
26-
27-
- name: Cache esp-idf
28-
uses: actions/cache@v4
29-
id: cache-esp-idf
30-
with:
31-
path: |
32-
~/.espressif
33-
${{ github.workspace }}/esp-idf
34-
key: ${{ runner.os }}-idf-v5.4.2
35-
36-
- name: Install ESP-IDF
37-
if: steps.cache-esp-idf.outputs.cache-hit != 'true'
38-
run: |
39-
git clone --depth=1 -b $IDF_VERSION https://github.com/espressif/esp-idf.git
40-
./esp-idf/install.sh
41-
env:
42-
IDF_VERSION: "v5.4.2"
43-
44-
- name: Setup environment
45-
run: |
46-
source tools/ci.sh && ci_esp32_idf542_setup
47-
source esp-idf/export.sh
48-
pip install future
49-
make -C m5stack submodules
50-
make -C m5stack patch
51-
make -C m5stack littlefs
52-
53-
54-
build:
55-
needs: setup
56-
runs-on: ubuntu-latest
57-
strategy:
58-
matrix:
59-
board:
60-
- M5STACK_AirQ
61-
- M5STACK_Atom_Echo
62-
- M5STACK_Atom_EchoS3R
63-
- M5STACK_Atom_Lite
64-
- M5STACK_Atom_Matrix
65-
- M5STACK_AtomS3
66-
- M5STACK_AtomS3_Lite
67-
- M5STACK_AtomS3R
68-
- M5STACK_AtomS3R_CAM
69-
- M5STACK_AtomS3U
70-
- M5STACK_AtomU
71-
- M5STACK_Basic
72-
- M5STACK_Basic_4MB
73-
- M5STACK_Capsule
74-
- M5STACK_Cardputer
75-
- M5STACK_CardputerADV
76-
- M5STACK_Core2
77-
- M5STACK_CoreInk
78-
- M5STACK_CoreS3
79-
- M5STACK_Dial
80-
- M5STACK_DinMeter
81-
- M5STACK_Fire
82-
- M5STACK_NanoC6
83-
- M5STACK_Paper
84-
- M5STACK_PaperS3
85-
- M5STACK_Stamp_PICO
86-
- M5STACK_StamPLC
87-
- M5STACK_StampS3
88-
- M5STACK_Station
89-
- M5STACK_StickC
90-
- M5STACK_StickC_PLUS
91-
- M5STACK_StickC_PLUS2
92-
- M5STACK_Tab5
93-
- M5STACK_Tough
94-
- M5STACK_Unit_C6L
95-
- Nesso_N1
96-
- ESPRESSIF_ESP32_S3_BOX_3
97-
- SEEED_STUDIO_XIAO_ESP32S3
98-
max-parallel: 4
99-
steps:
100-
- uses: actions/checkout@v4
101-
102-
- name: Install dependencies
103-
run: |
104-
sudo apt-get update
105-
sudo apt-get install -y git wget flex bison gperf quilt python3 python3-pip \
106-
python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
107-
108-
- name: Restore ESP-IDF cache
109-
uses: actions/cache@v4
110-
with:
111-
path: |
112-
~/.espressif
113-
${{ github.workspace }}/esp-idf
114-
key: ${{ runner.os }}-idf-v5.4.2
115-
116-
- name: Prepare environment
117-
run: |
118-
source esp-idf/export.sh
119-
120-
- name: Build M5Stack ${{ matrix.board }}
121-
if: startsWith(matrix.board, 'M5STACK')
122-
run: |
123-
source esp-idf/export.sh
124-
pip install future
125-
make -C m5stack submodules
126-
make -C m5stack patch
127-
make -C m5stack littlefs
128-
make -C m5stack BOARD=${{ matrix.board }} pack_all
129-
130-
- name: Build third-party ${{ matrix.board }}
131-
if: "!startsWith(matrix.board, 'M5STACK')"
132-
run: |
133-
source esp-idf/export.sh
134-
pip install future
135-
make -C m5stack submodules
136-
make -C m5stack patch
137-
make -C m5stack littlefs
138-
make -C third-party BOARD=${{ matrix.board }} pack_all
139-
140-
- name: Upload firmware artifact
141-
uses: actions/upload-artifact@v4
142-
with:
143-
name: firmware-${{ matrix.board }}
144-
path: |
145-
${{ startsWith(matrix.board, 'M5STACK') && 'm5stack' || 'third-party' }}/build-${{ matrix.board }}/uiflow-*-*.bin
146-
147-
- name: Upload firmware to release
148-
uses: softprops/action-gh-release@v2
149-
if: startsWith(github.ref, 'refs/tags/')
150-
env:
151-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
152-
with:
153-
files: |
154-
${{ startsWith(matrix.board, 'M5STACK') && 'm5stack' || 'third-party' }}/build-${{ matrix.board }}/uiflow-*-*.bin
14+
build-firmware:
15+
uses: ./.github/workflows/build-firmware.yml
16+
with:
17+
upload_artifacts: true
18+
upload_release: true

0 commit comments

Comments
 (0)