11on : [push, pull_request, workflow_dispatch]
22
3- name : Build
4-
53jobs :
6- matrix :
7- runs-on : ubuntu-latest
8- name : Fetch Build Keyboards
9- outputs :
10- matrix : ${{ steps.set-matrix.outputs.matrix }}
11- steps :
12- - name : Checkout
13- uses : actions/checkout@v2
14- - name : Install yaml2json
15- run : python3 -m pip install remarshal
16- - id : set-matrix
17- name : Fetch Build Matrix
18- run : |
19- matrix=$(yaml2json build.yaml | jq -c .)
20- yaml2json build.yaml
21- echo "::set-output name=matrix::${matrix}"
224 build :
23- runs-on : ubuntu-latest
24- container :
25- image : zmkfirmware/zmk-build-arm:stable
26- needs : matrix
27- name : Build
28- strategy :
29- fail-fast : false
30- matrix : ${{fromJson(needs.matrix.outputs.matrix)}}
31- steps :
32- - name : Prepare variables
33- id : variables
34- run : |
35- if [ -n "${{ matrix.shield }}" ]; then
36- EXTRA_CMAKE_ARGS="-DSHIELD=${{ matrix.shield }}"
37- ARTIFACT_NAME="${{ matrix.shield }}-${{ matrix.board }}-zmk"
38- DISPLAY_NAME="${{ matrix.shield }} - ${{ matrix.board }}"
39- else
40- EXTRA_CMAKE_ARGS=
41- DISPLAY_NAME="${{ matrix.board }}"
42- ARTIFACT_NAME="${{ matrix.board }}-zmk"
43- fi
44- echo ::set-output name=extra-cmake-args::${EXTRA_CMAKE_ARGS}
45- echo ::set-output name=artifact-name::${ARTIFACT_NAME}
46- echo ::set-output name=display-name::${DISPLAY_NAME}
47- - name : Checkout
48- uses : actions/checkout@v4
49- - name : Cache west modules
50- uses : actions/cache@v4
51- env :
52- cache-name : cache-zephyr-modules
53- with :
54- path : |
55- modules/
56- tools/
57- zephyr/
58- bootloader/
59- zmk/
60- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('manifest-dir/west.yml') }}
61- restore-keys : |
62- ${{ runner.os }}-build-${{ env.cache-name }}-
63- ${{ runner.os }}-build-
64- ${{ runner.os }}-
65- - name : West Init
66- run : west init -l config
67- - name : West Update
68- run : west update
69- - name : West Zephyr export
70- run : west zephyr-export
71- - name : West Build (${{ steps.variables.outputs.display-name }})
72- run : |
73- west build -s zmk/app -b ${{ matrix.board }} -- -DZMK_CONFIG=${GITHUB_WORKSPACE}/config ${{ steps.variables.outputs.extra-cmake-args }} ${{ matrix.cmake-args }}
74- - name : ${{ steps.variables.outputs.display-name }} DTS File
75- if : ${{ always() }}
76- run : |
77- if [ -f "build/zephyr/${{ matrix.board }}.dts.pre.tmp" ]; then cat -n build/zephyr/${{ matrix.board }}.dts.pre.tmp; fi
78- if [ -f "build/zephyr/zephyr.dts" ]; then cat -n build/zephyr/zephyr.dts; fi
79- - name : ${{ steps.variables.outputs.display-name }} Kconfig file
80- run : cat build/zephyr/.config | grep -v "^#" | grep -v "^$"
81- - name : Rename artifacts
82- run : |
83- mkdir build/artifacts
84- if [ -f build/zephyr/zmk.uf2 ]
85- then
86- cp build/zephyr/zmk.uf2 "build/artifacts/${{ steps.variables.outputs.artifact-name }}.uf2"
87- elif [ -f build/zephyr/zmk.hex ]
88- then
89- cp build/zephyr/zmk.hex "build/artifacts/${{ steps.variables.outputs.artifact-name }}.hex"
90- fi
91- - name : Archive (${{ steps.variables.outputs.display-name }})
92- uses : actions/upload-artifact@v4
93- with :
94- name : firmware
95- path : build/artifacts
5+ uses : zmkfirmware/zmk/.github/workflows/build-user-config.yml@main
0 commit comments