-
Notifications
You must be signed in to change notification settings - Fork 37
215 lines (205 loc) · 7.55 KB
/
build.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: Build
on:
push:
branches:
- main
- develop
- 'release-**'
jobs:
build:
strategy:
matrix:
device: [maixpy_m5stickv, maixpy_amigo, maixpy_bit, maixpy_dock, maixpy_yahboom, maixpy_cube, maixpy_wonder_mv]
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Remove unnecessary files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build for M5StickV
if: matrix.device == 'maixpy_m5stickv'
uses: docker/build-push-action@v6
with:
context: .
build-args: DEVICE=maixpy_m5stickv
push: true
tags: localhost:5000/selfcustody/krux-builder-m5stickv:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Extract firmware for M5StickV
id: extract-m5stickv
if: matrix.device == 'maixpy_m5stickv'
uses: shrink/actions-docker-extract@v3
with:
image: localhost:5000/selfcustody/krux-builder-m5stickv:latest
path: /src/firmware/Kboot/build/.
- name: Upload firmware for M5StickV
if: matrix.device == 'maixpy_m5stickv'
uses: actions/upload-artifact@v4
with:
path: ${{ steps.extract-m5stickv.outputs.destination }}
name: build-m5stickv
- name: Build for Amigo
if: matrix.device == 'maixpy_amigo'
uses: docker/build-push-action@v6
with:
context: .
build-args: DEVICE=maixpy_amigo
push: true
tags: localhost:5000/selfcustody/krux-builder-amigo:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Extract firmware for Amigo
id: extract-amigo
if: matrix.device == 'maixpy_amigo'
uses: shrink/actions-docker-extract@v3
with:
image: localhost:5000/selfcustody/krux-builder-amigo:latest
path: /src/firmware/Kboot/build/.
- name: Upload firmware for Amigo
if: matrix.device == 'maixpy_amigo'
uses: actions/upload-artifact@v4
with:
path: ${{ steps.extract-amigo.outputs.destination }}
name: build-amigo
- name: Build for Bit
if: matrix.device == 'maixpy_bit'
uses: docker/build-push-action@v6
with:
context: .
build-args: DEVICE=maixpy_bit
push: true
tags: localhost:5000/selfcustody/krux-builder-bit:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Extract firmware for Bit
id: extract-bit
if: matrix.device == 'maixpy_bit'
uses: shrink/actions-docker-extract@v3
with:
image: localhost:5000/selfcustody/krux-builder-bit:latest
path: /src/firmware/Kboot/build/.
- name: Upload firmware for Bit
if: matrix.device == 'maixpy_bit'
uses: actions/upload-artifact@v4
with:
path: ${{ steps.extract-bit.outputs.destination }}
name: build-bit
- name: Build for Dock
if: matrix.device == 'maixpy_dock'
uses: docker/build-push-action@v6
with:
context: .
build-args: DEVICE=maixpy_dock
push: true
tags: localhost:5000/selfcustody/krux-builder-dock:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Extract firmware for Dock
id: extract-dock
if: matrix.device == 'maixpy_dock'
uses: shrink/actions-docker-extract@v3
with:
image: localhost:5000/selfcustody/krux-builder-dock:latest
path: /src/firmware/Kboot/build/.
- name: Upload firmware for Dock
if: matrix.device == 'maixpy_dock'
uses: actions/upload-artifact@v4
with:
path: ${{ steps.extract-dock.outputs.destination }}
name: build-dock
- name: Build for Yahboom
if: matrix.device == 'maixpy_yahboom'
uses: docker/build-push-action@v6
with:
context: .
build-args: DEVICE=maixpy_yahboom
push: true
tags: localhost:5000/selfcustody/krux-builder-yahboom:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Extract firmware for Yahboom
id: extract-yahboom
if: matrix.device == 'maixpy_yahboom'
uses: shrink/actions-docker-extract@v3
with:
image: localhost:5000/selfcustody/krux-builder-yahboom:latest
path: /src/firmware/Kboot/build/.
- name: Upload firmware for Yahboom
if: matrix.device == 'maixpy_yahboom'
uses: actions/upload-artifact@v4
with:
path: ${{ steps.extract-yahboom.outputs.destination }}
name: build-yahboom
- name: Build for Cube
if: matrix.device == 'maixpy_cube'
uses: docker/build-push-action@v6
with:
context: .
build-args: DEVICE=maixpy_cube
push: true
tags: localhost:5000/selfcustody/krux-builder-cube:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Extract firmware for Cube
id: extract-cube
if: matrix.device == 'maixpy_cube'
uses: shrink/actions-docker-extract@v3
with:
image: localhost:5000/selfcustody/krux-builder-cube:latest
path: /src/firmware/Kboot/build/.
- name: Upload firmware for Cube
if: matrix.device == 'maixpy_cube'
uses: actions/upload-artifact@v4
with:
path: ${{ steps.extract-cube.outputs.destination }}
name: build-cube
- name: Build for WonderMV
if: matrix.device == 'maixpy_wonder_mv'
uses: docker/build-push-action@v6
with:
context: .
build-args: DEVICE=maixpy_wonder_mv
push: true
tags: localhost:5000/selfcustody/krux-builder-wonder-mv:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Extract firmware for WonderMV
id: extract-wonder-mv
if: matrix.device == 'maixpy_wonder_mv'
uses: shrink/actions-docker-extract@v3
with:
image: localhost:5000/selfcustody/krux-builder-wonder-mv:latest
path: /src/firmware/Kboot/build/.
- name: Upload firmware for WonderMV
if: matrix.device == 'maixpy_wonder_mv'
uses: actions/upload-artifact@v4
with:
path: ${{ steps.extract-wonder-mv.outputs.destination }}
name: build-wonder-mv
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache