Build firmware locally with docker

main
Ashelyn Dawn 1 year ago
parent 2e39a8acb4
commit ccdc6cad0a

@ -1,5 +0,0 @@
on: [push, pull_request, workflow_dispatch]
jobs:
build:
uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main

1
.gitignore vendored

@ -0,0 +1 @@
out/

@ -0,0 +1,18 @@
from zmkfirmware/zmk-build-arm:stable
workdir /build
run mkdir config
copy ./config/west.yml ./config/
run west init -l /build/config/
run west update
run west zephyr-export
copy ./config/ ./config
run west build -s zmk/app -b nice_nano_v2 -d build_left -- -DMZK_CONFIG=/build/config -DSHIELD=corne_left
run west build -s zmk/app -b nice_nano_v2 -d build_right -- -DMZK_CONFIG=/build/config -DSHIELD=corne_right
run mkdir -p out
run mv build_left/zephyr/zmk.uf2 ./out/corne_left-nice_nano_v2-zmk.uf2
run mv build_right/zephyr/zmk.uf2 ./out/corne_right-nice_nano_v2-zmk.uf2

@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -e
echo "Building keymap"
docker build .
if [ -d out ]; then
echo "Removing old keymap files"
rm -r out
fi
mkdir -p out
echo "Copying keymap files out of docker"
docker run -it \
--mount type=bind,source="$(pwd)/out",target=/out \
$(docker build . -q) \
bash -c 'cp ./out/* /out/'

@ -1,19 +0,0 @@
# This file generates the GitHub Actions matrix
# For simple board + shield combinations, add them
# to the top level board and shield arrays, for more
# control, add individual board + shield combinations to
# the `include` property, e.g:
#
# board: [ "nice_nano_v2" ]
# shield: [ "corne_left", "corne_right" ]
# include:
# - board: bdn9_rev2
# - board: nice_nano_v2
# shield: reviung41
#
---
include:
- board: nice_nano_v2
shield: corne_left
- board: nice_nano_v2
shield: corne_right
Loading…
Cancel
Save