From 2898a98968c14cdf2c4ecb392403791cf37ba4b1 Mon Sep 17 00:00:00 2001 From: "keymap-editor[bot]" <91849743+keymap-editor[bot]@users.noreply.github.com> Date: Fri, 2 Jan 2026 01:56:26 +0000 Subject: [PATCH 01/12] Switching command and option keys --- config/bakeneko60_go.keymap | 80 +++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/config/bakeneko60_go.keymap b/config/bakeneko60_go.keymap index 5c30bf8..99b8c49 100644 --- a/config/bakeneko60_go.keymap +++ b/config/bakeneko60_go.keymap @@ -5,74 +5,76 @@ */ #include +#include #include #include -#include / { keymap { compatible = "zmk,keymap"; default_layer { -// ------------------------------------------------------------------------------------------ -// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP|BKSP| -// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | "|" | -// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | -// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | MO(1) | -// | CTL | WIN | ALT | SPACE | ALT | WIN | MO(1) | CTL | -// ------------------------------------------------------------------------------------------ + // ------------------------------------------------------------------------------------------ + // | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP|BKSP| + // | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | "|" | + // | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | + // | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | MO(1) | + // | CTL | WIN | ALT | SPACE | ALT | WIN | MO(1) | CTL | + // ------------------------------------------------------------------------------------------ + bindings = < - &gresc &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &kp BSPC - &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH - &kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET - &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &mo 1 - &kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &kp RGUI &mo 1 &kp RCTRL +&gresc &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &kp BSPC +&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH +&kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET +&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &mo 1 +&kp LCTRL &kp LEFT_ALT &kp LEFT_COMMAND &kp SPACE &kp RIGHT_COMMAND &kp RIGHT_ALT &mo 1 &kp RCTRL >; }; rgb_layer { -// ------------------------------------------------------------------------------------------------ -// | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | DEL | -// | EFCT REV| | UP | | HUEUP | SATUP | BRIUP | SPDUP | | PGUP | | | | | -// | EFCT FWD | LT | DN | RT | HUEDN | SATDN | BRIDN | SPDDN | HOME | PGDN | END | | BOOTLDR | -// | | | | | | | | | | | | | | -// | | | | TOG RGB | PRT SCR | | | MO(2)| -// ------------------------------------------------------------------------------------------------ + // ------------------------------------------------------------------------------------------------ + // | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | DEL | + // | EFCT REV| | UP | | HUEUP | SATUP | BRIUP | SPDUP | | PGUP | | | | | + // | EFCT FWD | LT | DN | RT | HUEDN | SATDN | BRIDN | SPDDN | HOME | PGDN | END | | BOOTLDR | + // | | | | | | | | | | | | | | + // | | | | TOG RGB | PRT SCR | | | MO(2)| + // ------------------------------------------------------------------------------------------------ + bindings = < - &kp GRAVE &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &trans &kp DEL - &rgb_ug RGB_EFR &trans &kp UP &trans &rgb_ug RGB_HUI &rgb_ug RGB_SAI &rgb_ug RGB_BRI &rgb_ug RGB_SPI &trans &kp PGUP &trans &trans &trans &trans - &rgb_ug RGB_EFF &kp LEFT &kp DOWN &kp RIGHT &rgb_ug RGB_HUD &rgb_ug RGB_SAD &rgb_ug RGB_BRD &rgb_ug RGB_SPD &kp HOME &kp PGDN &kp END &trans &bootloader - &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans - &trans &trans &trans &rgb_ug RGB_TOG &kp PSCRN &trans &trans &mo 2 +&kp GRAVE &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &trans &kp DEL +&rgb_ug RGB_EFR &trans &kp UP &trans &rgb_ug RGB_HUI &rgb_ug RGB_SAI &rgb_ug RGB_BRI &rgb_ug RGB_SPI &trans &kp PGUP &trans &trans &trans &trans +&rgb_ug RGB_EFF &kp LEFT &kp DOWN &kp RIGHT &rgb_ug RGB_HUD &rgb_ug RGB_SAD &rgb_ug RGB_BRD &rgb_ug RGB_SPD &kp HOME &kp PGDN &kp END &trans &bootloader +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans +&trans &trans &trans &rgb_ug RGB_TOG &kp PSCRN &trans &trans &mo 2 >; }; bluetooth_layer { -// ------------------------------------------------------------------------------------------------ -// | BT CLR | | | | | | | | | | | | | | | -// | BT 1 | | | | | | | | | | | | | | -// | BT 2 | | | | | | | | | | | | Reset | -// | BT 3 | | | | | | | | | | | | | -// | BT 4 | | | | | | | | -// ------------------------------------------------------------------------------------------------ + // ------------------------------------------------------------------------------------------------ + // | BT CLR | | | | | | | | | | | | | | | + // | BT 1 | | | | | | | | | | | | | | + // | BT 2 | | | | | | | | | | | | Reset | + // | BT 3 | | | | | | | | | | | | | + // | BT 4 | | | | | | | | + // ------------------------------------------------------------------------------------------------ + bindings = < - &bt BT_CLR &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans - &bt BT_SEL 0 &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans - &bt BT_SEL 1 &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &sys_reset - &bt BT_SEL 2 &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans - &bt BT_SEL 3 &trans &trans &trans &trans &trans &trans &trans +&bt BT_CLR &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans +&bt BT_SEL 0 &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans +&bt BT_SEL 1 &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &sys_reset +&bt BT_SEL 2 &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans +&bt BT_SEL 3 &trans &trans &trans &trans &trans &trans &trans >; }; - }; combos { compatible = "zmk,combos"; + combo_bt { timeout-ms = <50>; key-positions = <61 62>; bindings = <&mo 2>; }; }; - }; From a8b8a641e045a8ff943bed76dde2d7904dc2e80e Mon Sep 17 00:00:00 2001 From: Brandon Kung Date: Thu, 1 Jan 2026 19:01:07 -0800 Subject: [PATCH 02/12] Configure ZEPHYR_BASE in build workflow Set ZEPHYR_BASE to point to the Zephyr checkout. --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d74fb89..e7703d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,3 +3,5 @@ on: [push, pull_request, workflow_dispatch] jobs: build: uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main +# Point Zephyr tooling to the Zephyr checkout that the job fetches + ZEPHYR_BASE: ${{ github.workspace }}/zephyr From f6f61f9908667857e2db77aca3139de91b96c9f6 Mon Sep 17 00:00:00 2001 From: Brandon Kung Date: Thu, 1 Jan 2026 19:03:09 -0800 Subject: [PATCH 03/12] Add ZEPHYR_BASE environment variable to build job Set ZEPHYR_BASE environment variable for Zephyr tooling. --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7703d7..79a5483 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,5 +3,6 @@ on: [push, pull_request, workflow_dispatch] jobs: build: uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main + env: # Point Zephyr tooling to the Zephyr checkout that the job fetches ZEPHYR_BASE: ${{ github.workspace }}/zephyr From afcf72972a83b61feec18b6906a9aaa30f516b98 Mon Sep 17 00:00:00 2001 From: Brandon Kung Date: Thu, 1 Jan 2026 19:06:18 -0800 Subject: [PATCH 04/12] Fix comment formatting for ZEPHYR_BASE --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79a5483..e69f230 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,5 +4,5 @@ jobs: build: uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main env: -# Point Zephyr tooling to the Zephyr checkout that the job fetches + # Point Zephyr tooling to the Zephyr checkout that the job fetches ZEPHYR_BASE: ${{ github.workspace }}/zephyr From dcb93c5f9397de6ea6cee83e80757d942bfc0381 Mon Sep 17 00:00:00 2001 From: Brandon Kung Date: Thu, 1 Jan 2026 19:07:56 -0800 Subject: [PATCH 05/12] Add ZEPHYR_BASE environment variable Added environment variable ZEPHYR_BASE to make Zephyr sources visible. --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e69f230..8cfbb77 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,9 @@ on: [push, pull_request, workflow_dispatch] +env: + # Make Zephyr sources visible to the called reusable workflow + ZEPHYR_BASE: ${{ github.workspace }}/zephyr + jobs: build: uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main - env: - # Point Zephyr tooling to the Zephyr checkout that the job fetches - ZEPHYR_BASE: ${{ github.workspace }}/zephyr From cea331163f72807423d4710555b9e289150c02ad Mon Sep 17 00:00:00 2001 From: Brandon Kung Date: Thu, 1 Jan 2026 19:16:27 -0800 Subject: [PATCH 06/12] Refactor GitHub Actions workflow for build process --- .github/workflows/build.yml | 152 ++++++++++++++++++++++++++++++++++-- 1 file changed, 147 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8cfbb77..1c6a20d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,151 @@ on: [push, pull_request, workflow_dispatch] -env: - # Make Zephyr sources visible to the called reusable workflow - ZEPHYR_BASE: ${{ github.workspace }}/zephyr - jobs: + matrix: + runs-on: ubuntu-22.04 + name: Fetch Build Keyboards + outputs: + build_matrix: ${{ env.build_matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Fetch Build Matrix + run: | + echo "build_matrix=$(yq -oj -I0 'build.yaml')" >> $GITHUB_ENV + yq -oj "build.yaml" + build: - uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main + runs-on: ubuntu-latest + container: + image: zmkfirmware/zmk-build-arm:stable + needs: matrix + name: Build + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.matrix.outputs.build_matrix) }} + steps: + - name: Act Workaround # https://github.com/nektos/act/issues/973 + if: ${{ env.ACT }} + run: | + apt-get update && apt-get install -y curl unzip + curl -fsSL https://deb.nodesource.com/setup_22.x | bash && apt install -y nodejs + + - name: Checkout + uses: actions/checkout@v4 + + - name: Create build directory + run: | + echo "build_dir=$(mktemp -d)" >> $GITHUB_ENV + + - name: Prepare variables + shell: bash -x {0} + env: + board: ${{ matrix.board }} + shield: ${{ matrix.shield }} + artifact_name: ${{ matrix.artifact-name }} + snippet: ${{ matrix.snippet }} + run: | + if [ -e zephyr/module.yml ]; then + export zmk_load_arg=" -DZMK_EXTRA_MODULES='${GITHUB_WORKSPACE}'" + new_tmp_dir="${TMPDIR:-/tmp}/zmk-config" + mkdir -p "${new_tmp_dir}" + echo "base_dir=${new_tmp_dir}" >> $GITHUB_ENV + else + echo "base_dir=${GITHUB_WORKSPACE}" >> $GITHUB_ENV + fi + + if [ -n "${snippet}" ]; then + extra_west_args="-S \"${snippet}\"" + fi + + echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV + echo "extra_west_args=${extra_west_args}" >> $GITHUB_ENV + echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}${zmk_load_arg}" >> $GITHUB_ENV + echo "display_name=${shield:+$shield - }${board}" >> $GITHUB_ENV + echo "artifact_name=${artifact_name:-${shield:+$shield-}${board//\//_}-zmk}" >> $GITHUB_ENV + + - name: Copy config files to isolated temporary directory + run: | + if [ "${{ env.base_dir }}" != "${GITHUB_WORKSPACE}" ]; then + mkdir -p "${{ env.base_dir }}/${{ inputs.config_path:-config }}" + cp -R config/* "${{ env.base_dir }}/config/" + fi + + - name: Cache west modules + uses: actions/cache@v4 + continue-on-error: true + env: + cache_name: cache-zephyr-${{ env.zephyr_version }}-modules + with: + path: | + ${{ env.base_dir }}/modules/ + ${{ env.base_dir }}/tools/ + ${{ env.base_dir }}/zephyr/ + ${{ env.base_dir }}/bootloader/ + ${{ env.base_dir }}/zmk/ + key: ${{ runner.os }}-build-${{ env.cache_name }}-${{ hashFiles('**/west.yml', '**/build.yaml') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache_name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - name: Install Python deps + run: | + python3 -m pip install --upgrade pip setuptools wheel + if [ -f zephyr/scripts/requirements.txt ]; then + python3 -m pip install -r zephyr/scripts/requirements.txt || true + fi + python3 -m pip install west + + - name: West Init + working-directory: ${{ env.base_dir }} + run: west init -l "${{ env.base_dir }}/config" + + - name: West Update (full fetch) + working-directory: ${{ env.base_dir }} + # NOTE: We intentionally do a full west update (no tree:0 filter) so module files + # such as soc Kconfig fragments are present for zephyr export / Kconfig parsing. + run: west update + + - name: West Zephyr export + working-directory: ${{ env.base_dir }} + run: west zephyr-export + + - name: Set ZEPHYR_BASE for CMake/Kconfig + run: | + echo "ZEPHYR_BASE=${{ env.base_dir }}/zephyr" >> $GITHUB_ENV + + - name: West Build (${{ env.display_name }}) + working-directory: ${{ env.base_dir }} + shell: sh -x {0} + run: | + west build -s zmk/app -d "${{ env.build_dir }}" -b "${{ matrix.board }}" ${{ env.extra_west_args }} -- -DZMK_CONFIG=${{ env.base_dir }}/config ${{ env.extra_cmake_args }} + + - name: ${{ env.display_name }} Kconfig file + run: | + if [ -f "${{ env.build_dir }}/zephyr/.config" ] + then + grep -v -e "^#" -e "^$" "${{ env.build_dir }}/zephyr/.config" | sort + else + echo "No Kconfig output" + fi + if: ${{ !cancelled() }} + + - name: Rename artifacts + shell: sh -x {0} + run: | + mkdir -p "${{ env.build_dir }}/artifacts" + if [ -f "${{ env.build_dir }}/zephyr/zmk.uf2" ] + then + cp "${{ env.build_dir }}/zephyr/zmk.uf2" "${{ env.build_dir }}/artifacts/${{ env.artifact_name }}.uf2" + elif [ -f "${{ env.build_dir }}/zephyr/zmk.bin" ] + then + cp "${{ env.build_dir }}/zephyr/zmk.bin" "${{ env.build_dir }}/artifacts/${{ env.artifact_name }}.bin" + fi + + - name: Archive (${{ env.display_name }}) + uses: actions/upload-artifact@v4 + with: + name: artifact-${{ env.artifact_name }} + path: ${{ env.build_dir }}/artifacts From 413ac4fcb676d2717c029e1dae116f2df4b50100 Mon Sep 17 00:00:00 2001 From: Brandon Kung Date: Thu, 1 Jan 2026 19:19:26 -0800 Subject: [PATCH 07/12] Add files via upload --- .../github_workflows_build_Version2.yml | 151 ++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 .github/workflows/github_workflows_build_Version2.yml diff --git a/.github/workflows/github_workflows_build_Version2.yml b/.github/workflows/github_workflows_build_Version2.yml new file mode 100644 index 0000000..6c76117 --- /dev/null +++ b/.github/workflows/github_workflows_build_Version2.yml @@ -0,0 +1,151 @@ +on: [push, pull_request, workflow_dispatch] + +jobs: + matrix: + runs-on: ubuntu-22.04 + name: Fetch Build Keyboards + outputs: + build_matrix: ${{ env.build_matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Fetch Build Matrix + run: | + echo "build_matrix=$(yq -oj -I0 'build.yaml')" >> $GITHUB_ENV + yq -oj "build.yaml" + + build: + runs-on: ubuntu-latest + container: + image: zmkfirmware/zmk-build-arm:stable + needs: matrix + name: Build + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.matrix.outputs.build_matrix) }} + steps: + - name: Act Workaround # https://github.com/nektos/act/issues/973 + if: ${{ env.ACT }} + run: | + apt-get update && apt-get install -y curl unzip + curl -fsSL https://deb.nodesource.com/setup_22.x | bash && apt install -y nodejs + + - name: Checkout + uses: actions/checkout@v4 + + - name: Create build directory + run: | + echo "build_dir=$(mktemp -d)" >> $GITHUB_ENV + + - name: Prepare variables + shell: bash -x {0} + env: + board: ${{ matrix.board }} + shield: ${{ matrix.shield }} + artifact_name: ${{ matrix.artifact-name }} + snippet: ${{ matrix.snippet }} + run: | + if [ -e zephyr/module.yml ]; then + export zmk_load_arg=" -DZMK_EXTRA_MODULES='${GITHUB_WORKSPACE}'" + new_tmp_dir="${TMPDIR:-/tmp}/zmk-config" + mkdir -p "${new_tmp_dir}" + echo "base_dir=${new_tmp_dir}" >> $GITHUB_ENV + else + echo "base_dir=${GITHUB_WORKSPACE}" >> $GITHUB_ENV + fi + + if [ -n "${snippet}" ]; then + extra_west_args="-S \"${snippet}\"" + fi + + echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV + echo "extra_west_args=${extra_west_args}" >> $GITHUB_ENV + echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}${zmk_load_arg}" >> $GITHUB_ENV + echo "display_name=${shield:+$shield - }${board}" >> $GITHUB_ENV + echo "artifact_name=${artifact_name:-${shield:+$shield-}${board//\//_}-zmk}" >> $GITHUB_ENV + + - name: Copy config files to isolated temporary directory + run: | + if [ "${{ env.base_dir }}" != "${GITHUB_WORKSPACE}" ]; then + mkdir -p "${{ env.base_dir }}/${{ inputs.config_path:-config }}" + cp -R config/* "${{ env.base_dir }}/config/" + fi + + - name: Cache west modules + uses: actions/cache@v4 + continue-on-error: true + env: + cache_name: cache-zephyr-${{ env.zephyr_version }}-modules + with: + path: | + ${{ env.base_dir }}/modules/ + ${{ env.base_dir }}/tools/ + ${{ env.base_dir }}/zephyr/ + ${{ env.base_dir }}/bootloader/ + ${{ env.base_dir }}/zmk/ + key: ${{ runner.os }}-build-${{ env.cache_name }}-${{ hashFiles('**/west.yml', '**/build.yaml') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache_name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - name: Install Python deps + run: | + python3 -m pip install --upgrade pip setuptools wheel + if [ -f zephyr/scripts/requirements.txt ]; then + python3 -m pip install -r zephyr/scripts/requirements.txt || true + fi + python3 -m pip install west + + - name: West Init + working-directory: ${{ env.base_dir }} + run: west init -l "${{ env.base_dir }}/config" + + - name: West Update (full fetch) + working-directory: ${{ env.base_dir }} + # NOTE: We intentionally do a full west update (no tree:0 filter) so module files + # such as soc Kconfig fragments are present for zephyr export / Kconfig parsing. + run: west update + + - name: West Zephyr export + working-directory: ${{ env.base_dir }} + run: west zephyr-export + + - name: Set ZEPHYR_BASE for CMake/Kconfig + run: | + echo "ZEPHYR_BASE=${{ env.base_dir }}/zephyr" >> $GITHUB_ENV + + - name: West Build (${{ env.display_name }}) + working-directory: ${{ env.base_dir }} + shell: sh -x {0} + run: | + west build -s zmk/app -d "${{ env.build_dir }}" -b "${{ matrix.board }}" ${{ env.extra_west_args }} -- -DZMK_CONFIG=${{ env.base_dir }}/config ${{ env.extra_cmake_args }} + + - name: ${{ env.display_name }} Kconfig file + run: | + if [ -f "${{ env.build_dir }}/zephyr/.config" ] + then + grep -v -e "^#" -e "^$" "${{ env.build_dir }}/zephyr/.config" | sort + else + echo "No Kconfig output" + fi + if: ${{ !cancelled() }} + + - name: Rename artifacts + shell: sh -x {0} + run: | + mkdir -p "${{ env.build_dir }}/artifacts" + if [ -f "${{ env.build_dir }}/zephyr/zmk.uf2" ] + then + cp "${{ env.build_dir }}/zephyr/zmk.uf2" "${{ env.build_dir }}/artifacts/${{ env.artifact_name }}.uf2" + elif [ -f "${{ env.build_dir }}/zephyr/zmk.bin" ] + then + cp "${{ env.build_dir }}/zephyr/zmk.bin" "${{ env.build_dir }}/artifacts/${{ env.artifact_name }}.bin" + fi + + - name: Archive (${{ env.display_name }}) + uses: actions/upload-artifact@v4 + with: + name: artifact-${{ env.artifact_name }} + path: ${{ env.build_dir }}/artifacts \ No newline at end of file From 3c6a74a4991bf35b083b04ced92f7f6c2f406cd3 Mon Sep 17 00:00:00 2001 From: Brandon Kung Date: Thu, 1 Jan 2026 19:20:21 -0800 Subject: [PATCH 08/12] Delete .github/workflows/github_workflows_build_Version2.yml --- .../github_workflows_build_Version2.yml | 151 ------------------ 1 file changed, 151 deletions(-) delete mode 100644 .github/workflows/github_workflows_build_Version2.yml diff --git a/.github/workflows/github_workflows_build_Version2.yml b/.github/workflows/github_workflows_build_Version2.yml deleted file mode 100644 index 6c76117..0000000 --- a/.github/workflows/github_workflows_build_Version2.yml +++ /dev/null @@ -1,151 +0,0 @@ -on: [push, pull_request, workflow_dispatch] - -jobs: - matrix: - runs-on: ubuntu-22.04 - name: Fetch Build Keyboards - outputs: - build_matrix: ${{ env.build_matrix }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Fetch Build Matrix - run: | - echo "build_matrix=$(yq -oj -I0 'build.yaml')" >> $GITHUB_ENV - yq -oj "build.yaml" - - build: - runs-on: ubuntu-latest - container: - image: zmkfirmware/zmk-build-arm:stable - needs: matrix - name: Build - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.matrix.outputs.build_matrix) }} - steps: - - name: Act Workaround # https://github.com/nektos/act/issues/973 - if: ${{ env.ACT }} - run: | - apt-get update && apt-get install -y curl unzip - curl -fsSL https://deb.nodesource.com/setup_22.x | bash && apt install -y nodejs - - - name: Checkout - uses: actions/checkout@v4 - - - name: Create build directory - run: | - echo "build_dir=$(mktemp -d)" >> $GITHUB_ENV - - - name: Prepare variables - shell: bash -x {0} - env: - board: ${{ matrix.board }} - shield: ${{ matrix.shield }} - artifact_name: ${{ matrix.artifact-name }} - snippet: ${{ matrix.snippet }} - run: | - if [ -e zephyr/module.yml ]; then - export zmk_load_arg=" -DZMK_EXTRA_MODULES='${GITHUB_WORKSPACE}'" - new_tmp_dir="${TMPDIR:-/tmp}/zmk-config" - mkdir -p "${new_tmp_dir}" - echo "base_dir=${new_tmp_dir}" >> $GITHUB_ENV - else - echo "base_dir=${GITHUB_WORKSPACE}" >> $GITHUB_ENV - fi - - if [ -n "${snippet}" ]; then - extra_west_args="-S \"${snippet}\"" - fi - - echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV - echo "extra_west_args=${extra_west_args}" >> $GITHUB_ENV - echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}${zmk_load_arg}" >> $GITHUB_ENV - echo "display_name=${shield:+$shield - }${board}" >> $GITHUB_ENV - echo "artifact_name=${artifact_name:-${shield:+$shield-}${board//\//_}-zmk}" >> $GITHUB_ENV - - - name: Copy config files to isolated temporary directory - run: | - if [ "${{ env.base_dir }}" != "${GITHUB_WORKSPACE}" ]; then - mkdir -p "${{ env.base_dir }}/${{ inputs.config_path:-config }}" - cp -R config/* "${{ env.base_dir }}/config/" - fi - - - name: Cache west modules - uses: actions/cache@v4 - continue-on-error: true - env: - cache_name: cache-zephyr-${{ env.zephyr_version }}-modules - with: - path: | - ${{ env.base_dir }}/modules/ - ${{ env.base_dir }}/tools/ - ${{ env.base_dir }}/zephyr/ - ${{ env.base_dir }}/bootloader/ - ${{ env.base_dir }}/zmk/ - key: ${{ runner.os }}-build-${{ env.cache_name }}-${{ hashFiles('**/west.yml', '**/build.yaml') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache_name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - name: Install Python deps - run: | - python3 -m pip install --upgrade pip setuptools wheel - if [ -f zephyr/scripts/requirements.txt ]; then - python3 -m pip install -r zephyr/scripts/requirements.txt || true - fi - python3 -m pip install west - - - name: West Init - working-directory: ${{ env.base_dir }} - run: west init -l "${{ env.base_dir }}/config" - - - name: West Update (full fetch) - working-directory: ${{ env.base_dir }} - # NOTE: We intentionally do a full west update (no tree:0 filter) so module files - # such as soc Kconfig fragments are present for zephyr export / Kconfig parsing. - run: west update - - - name: West Zephyr export - working-directory: ${{ env.base_dir }} - run: west zephyr-export - - - name: Set ZEPHYR_BASE for CMake/Kconfig - run: | - echo "ZEPHYR_BASE=${{ env.base_dir }}/zephyr" >> $GITHUB_ENV - - - name: West Build (${{ env.display_name }}) - working-directory: ${{ env.base_dir }} - shell: sh -x {0} - run: | - west build -s zmk/app -d "${{ env.build_dir }}" -b "${{ matrix.board }}" ${{ env.extra_west_args }} -- -DZMK_CONFIG=${{ env.base_dir }}/config ${{ env.extra_cmake_args }} - - - name: ${{ env.display_name }} Kconfig file - run: | - if [ -f "${{ env.build_dir }}/zephyr/.config" ] - then - grep -v -e "^#" -e "^$" "${{ env.build_dir }}/zephyr/.config" | sort - else - echo "No Kconfig output" - fi - if: ${{ !cancelled() }} - - - name: Rename artifacts - shell: sh -x {0} - run: | - mkdir -p "${{ env.build_dir }}/artifacts" - if [ -f "${{ env.build_dir }}/zephyr/zmk.uf2" ] - then - cp "${{ env.build_dir }}/zephyr/zmk.uf2" "${{ env.build_dir }}/artifacts/${{ env.artifact_name }}.uf2" - elif [ -f "${{ env.build_dir }}/zephyr/zmk.bin" ] - then - cp "${{ env.build_dir }}/zephyr/zmk.bin" "${{ env.build_dir }}/artifacts/${{ env.artifact_name }}.bin" - fi - - - name: Archive (${{ env.display_name }}) - uses: actions/upload-artifact@v4 - with: - name: artifact-${{ env.artifact_name }} - path: ${{ env.build_dir }}/artifacts \ No newline at end of file From 693c02618bf9dcbdb0b040183efb5591a67e396e Mon Sep 17 00:00:00 2001 From: Brandon Kung Date: Thu, 1 Jan 2026 19:20:39 -0800 Subject: [PATCH 09/12] Fix indentation in build.yml artifact path From db4e696fd49c7167942780ce208a969d5d82f597 Mon Sep 17 00:00:00 2001 From: Brandon Kung Date: Thu, 1 Jan 2026 19:24:01 -0800 Subject: [PATCH 10/12] Refactor build workflow by removing redundant steps Removed unnecessary steps for setting up the build environment and caching modules. --- .github/workflows/build.yml | 104 +----------------------------------- 1 file changed, 1 insertion(+), 103 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c6a20d..85fdb44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,106 +46,4 @@ jobs: artifact_name: ${{ matrix.artifact-name }} snippet: ${{ matrix.snippet }} run: | - if [ -e zephyr/module.yml ]; then - export zmk_load_arg=" -DZMK_EXTRA_MODULES='${GITHUB_WORKSPACE}'" - new_tmp_dir="${TMPDIR:-/tmp}/zmk-config" - mkdir -p "${new_tmp_dir}" - echo "base_dir=${new_tmp_dir}" >> $GITHUB_ENV - else - echo "base_dir=${GITHUB_WORKSPACE}" >> $GITHUB_ENV - fi - - if [ -n "${snippet}" ]; then - extra_west_args="-S \"${snippet}\"" - fi - - echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV - echo "extra_west_args=${extra_west_args}" >> $GITHUB_ENV - echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}${zmk_load_arg}" >> $GITHUB_ENV - echo "display_name=${shield:+$shield - }${board}" >> $GITHUB_ENV - echo "artifact_name=${artifact_name:-${shield:+$shield-}${board//\//_}-zmk}" >> $GITHUB_ENV - - - name: Copy config files to isolated temporary directory - run: | - if [ "${{ env.base_dir }}" != "${GITHUB_WORKSPACE}" ]; then - mkdir -p "${{ env.base_dir }}/${{ inputs.config_path:-config }}" - cp -R config/* "${{ env.base_dir }}/config/" - fi - - - name: Cache west modules - uses: actions/cache@v4 - continue-on-error: true - env: - cache_name: cache-zephyr-${{ env.zephyr_version }}-modules - with: - path: | - ${{ env.base_dir }}/modules/ - ${{ env.base_dir }}/tools/ - ${{ env.base_dir }}/zephyr/ - ${{ env.base_dir }}/bootloader/ - ${{ env.base_dir }}/zmk/ - key: ${{ runner.os }}-build-${{ env.cache_name }}-${{ hashFiles('**/west.yml', '**/build.yaml') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache_name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - name: Install Python deps - run: | - python3 -m pip install --upgrade pip setuptools wheel - if [ -f zephyr/scripts/requirements.txt ]; then - python3 -m pip install -r zephyr/scripts/requirements.txt || true - fi - python3 -m pip install west - - - name: West Init - working-directory: ${{ env.base_dir }} - run: west init -l "${{ env.base_dir }}/config" - - - name: West Update (full fetch) - working-directory: ${{ env.base_dir }} - # NOTE: We intentionally do a full west update (no tree:0 filter) so module files - # such as soc Kconfig fragments are present for zephyr export / Kconfig parsing. - run: west update - - - name: West Zephyr export - working-directory: ${{ env.base_dir }} - run: west zephyr-export - - - name: Set ZEPHYR_BASE for CMake/Kconfig - run: | - echo "ZEPHYR_BASE=${{ env.base_dir }}/zephyr" >> $GITHUB_ENV - - - name: West Build (${{ env.display_name }}) - working-directory: ${{ env.base_dir }} - shell: sh -x {0} - run: | - west build -s zmk/app -d "${{ env.build_dir }}" -b "${{ matrix.board }}" ${{ env.extra_west_args }} -- -DZMK_CONFIG=${{ env.base_dir }}/config ${{ env.extra_cmake_args }} - - - name: ${{ env.display_name }} Kconfig file - run: | - if [ -f "${{ env.build_dir }}/zephyr/.config" ] - then - grep -v -e "^#" -e "^$" "${{ env.build_dir }}/zephyr/.config" | sort - else - echo "No Kconfig output" - fi - if: ${{ !cancelled() }} - - - name: Rename artifacts - shell: sh -x {0} - run: | - mkdir -p "${{ env.build_dir }}/artifacts" - if [ -f "${{ env.build_dir }}/zephyr/zmk.uf2" ] - then - cp "${{ env.build_dir }}/zephyr/zmk.uf2" "${{ env.build_dir }}/artifacts/${{ env.artifact_name }}.uf2" - elif [ -f "${{ env.build_dir }}/zephyr/zmk.bin" ] - then - cp "${{ env.build_dir }}/zephyr/zmk.bin" "${{ env.build_dir }}/artifacts/${{ env.artifact_name }}.bin" - fi - - - name: Archive (${{ env.display_name }}) - uses: actions/upload-artifact@v4 - with: - name: artifact-${{ env.artifact_name }} - path: ${{ env.build_dir }}/artifacts + if [ From 7690b61d4356eed1837d42c23885e55a0f319e99 Mon Sep 17 00:00:00 2001 From: Brandon Kung Date: Thu, 1 Jan 2026 19:33:00 -0800 Subject: [PATCH 11/12] Remove matrix job from build workflow --- .github/workflows/build.yml | 46 +------------------------------------ 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85fdb44..d74fb89 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,49 +1,5 @@ on: [push, pull_request, workflow_dispatch] jobs: - matrix: - runs-on: ubuntu-22.04 - name: Fetch Build Keyboards - outputs: - build_matrix: ${{ env.build_matrix }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Fetch Build Matrix - run: | - echo "build_matrix=$(yq -oj -I0 'build.yaml')" >> $GITHUB_ENV - yq -oj "build.yaml" - build: - runs-on: ubuntu-latest - container: - image: zmkfirmware/zmk-build-arm:stable - needs: matrix - name: Build - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.matrix.outputs.build_matrix) }} - steps: - - name: Act Workaround # https://github.com/nektos/act/issues/973 - if: ${{ env.ACT }} - run: | - apt-get update && apt-get install -y curl unzip - curl -fsSL https://deb.nodesource.com/setup_22.x | bash && apt install -y nodejs - - - name: Checkout - uses: actions/checkout@v4 - - - name: Create build directory - run: | - echo "build_dir=$(mktemp -d)" >> $GITHUB_ENV - - - name: Prepare variables - shell: bash -x {0} - env: - board: ${{ matrix.board }} - shield: ${{ matrix.shield }} - artifact_name: ${{ matrix.artifact-name }} - snippet: ${{ matrix.snippet }} - run: | - if [ + uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main From 4c573e019468de329fbcd272115bf92ef5b1c498 Mon Sep 17 00:00:00 2001 From: Brandon Kung Date: Thu, 1 Jan 2026 19:42:44 -0800 Subject: [PATCH 12/12] Update build-user-config workflow version to v0.3.0 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d74fb89..5e907b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,4 +2,4 @@ on: [push, pull_request, workflow_dispatch] jobs: build: - uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main + uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@v0.3.0