Merge pull request #455 from selfcustody/release-24.09.0 #363
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |