Skip to content

Instantly share code, notes, and snippets.

@shabegom
Created February 27, 2024 15:05
Show Gist options
  • Save shabegom/69c4ddc040dc41cd92ef717d4d49dc41 to your computer and use it in GitHub Desktop.
Save shabegom/69c4ddc040dc41cd92ef717d4d49dc41 to your computer and use it in GitHub Desktop.
Building ZMK firmware for leeloo micro v1.1 using Github Actions

The Leeloo v2.1 and Leeloo-Mcro v1.1 use an unreleased power domain handling feature of ZMK. Building the firmware of these keyboards using Github Actions requires some adjustments to the default configuration. The following are the steps I followed to get Github Actions working with the ClicketySplit fork of ZMK.

Initial Setup

Follow the instructions to install ZMK for GitHub Actions. Select Leeloo-Micro as your keyboard when prompted. I had issues with pushing the local repository to github because https authentication has been deprecated. I fixed this by updating .git > config to use SSH connection. I recommend going through the build process once with the defaults to make sure everything is working as expected.

Adjust the github workflow to use ClicketySplit fork

In .github > workflows > build.yml:

  • Change uses to point to: uses: ClicketySplit/zmk/.github/workflows/build-user-config.yml@leeloo_micro_v1.1_power_domain.

This uses the Github Action in the ClicketySplit fork on the leeloo_micro_v1.1_power_domain branch. When I reviewed the forked workflow it looked the same as upstream but this ensures against any future changes. Your build.yml should look like:

on: [push, pull_request, workflow_dispatch]

jobs:
  build:
    uses: ClicketySplit/zmk/.github/workflows/build-user-config.yml@leeloo_micro_v1.1_power_domain

Adjust west.yml

In config > west.yml:

  • Under remotes change name to name: ClicketySplit and url-base to url-base: https://github.com/ClicketySplit
  • Under projects chage remote to remote: ClicketySplit and revision to revision: leeloo_micro_v1.1_power_domain

This is the most important change as it tells the Github Action to pull shield and board information from the ClicketySplit fork and the proper branch. If you are building the Leeloo v2.1, update the revision to point to the proper branch. Your west.yml should look like:

 manifest:
   remotes:
     - name: ClicketySplit
       url-base: https://github.com/ClicketySplit
   projects:
     - name: zmk
       remote: ClicketySplit
       revision: leeloo_micro_v1.1_power_domain
       import: app/west.yml
   self:
     path: config

Update build.yaml for your board and shield

In the directory root you'll need to update build.yaml to include the appropriate board and shield for building the Leeloo-Micro firmware. I used the build guide to find the right board and shield. My build.yaml looks like:

---
include:
  - board: nice_nano_v2
    shield: leeloo_micro_rev2_left nice_view_adapter nice_view
  - board: nice_nano_v2
    shield: leeloo_micro_rev2_right nice_view_adapter nice_view

Add your keymap and update the config

At this point you might want to try pushing these changes to the remote repo and ensure the workflows runs as expected. I watch the build steps to ensure west is pulling from the ClicketySplit fork as expected. If the workflow runs successfully, the final step is to add your own .keymap to the config folder. If you have niceview displays or rotary encorders make sure to uncomment the appropriate lines in leeloo_micro.conf.

You should now be able to build the Leeloo-Micro firmware any time you push changes to the Github repository. I've been using Nick Coutsos Keymap Editor as a nice WYSIWG tool that automatically builds the firmware when you save changes.

To flash your keyboard, follow the instructions in the build guide

Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment