Skip to content

Commit

Permalink
Initial User Config.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrzealot committed Mar 7, 2022
0 parents commit aafdba7
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 0 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
on: [push, pull_request, workflow_dispatch]

name: Build

jobs:
matrix:
runs-on: ubuntu-latest
name: Fetch Build Keyboards
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install yaml2json
run: python3 -m pip install remarshal
- id: set-matrix
name: Fetch Build Matrix
run: |
matrix=$(yaml2json build.yaml | jq -c .)
yaml2json build.yaml
echo "::set-output name=matrix::${matrix}"
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.matrix)}}
steps:
- name: Prepare variables
id: variables
run: |
if [ -n "${{ matrix.shield }}" ]; then
EXTRA_CMAKE_ARGS="-DSHIELD=${{ matrix.shield }}"
ARTIFACT_NAME="${{ matrix.shield }}-${{ matrix.board }}-zmk"
DISPLAY_NAME="${{ matrix.shield }} - ${{ matrix.board }}"
else
EXTRA_CMAKE_ARGS=
DISPLAY_NAME="${{ matrix.board }}"
ARTIFACT_NAME="${{ matrix.board }}-zmk"
fi
echo ::set-output name=extra-cmake-args::${EXTRA_CMAKE_ARGS}
echo ::set-output name=artifact-name::${ARTIFACT_NAME}
echo ::set-output name=display-name::${DISPLAY_NAME}
- name: Checkout
uses: actions/checkout@v2
- name: Cache west modules
uses: actions/cache@v2
env:
cache-name: cache-zephyr-modules
with:
path: |
modules/
tools/
zephyr/
bootloader/
zmk/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('manifest-dir/west.yml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: West Init
run: west init -l config
- name: West Update
run: west update
- name: West Zephyr export
run: west zephyr-export
- name: West Build (${{ steps.variables.outputs.display-name }})
run: |
west build -s zmk/app -b ${{ matrix.board }} -- -DZMK_CONFIG=${GITHUB_WORKSPACE}/config ${{ steps.variables.outputs.extra-cmake-args }} ${{ matrix.cmake-args }}
- name: ${{ steps.variables.outputs.display-name }} DTS File
if: ${{ always() }}
run: |
if [ -f "build/zephyr/${{ matrix.board }}.dts.pre.tmp" ]; then cat -n build/zephyr/${{ matrix.board }}.dts.pre.tmp; fi
if [ -f "build/zephyr/zephyr.dts" ]; then cat -n build/zephyr/zephyr.dts; fi
- name: ${{ steps.variables.outputs.display-name }} Kconfig file
run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$"
- name: Rename artifacts
run: |
mkdir build/artifacts
if [ -f build/zephyr/zmk.uf2 ]
then
cp build/zephyr/zmk.uf2 "build/artifacts/${{ steps.variables.outputs.artifact-name }}.uf2"
elif [ -f build/zephyr/zmk.hex ]
then
cp build/zephyr/zmk.hex "build/artifacts/${{ steps.variables.outputs.artifact-name }}.hex"
fi
- name: Archive (${{ steps.variables.outputs.display-name }})
uses: actions/upload-artifact@v2
with:
name: firmware
path: build/artifacts
17 changes: 17 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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
shield: eek
Empty file added config/eek.conf
Empty file.
56 changes: 56 additions & 0 deletions config/eek.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/outputs.h>

/ {
keymap {
compatible = "zmk,keymap";

default {
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Q | W | E | R | T | | Y | U | I | O | P |
// A | S | D | F | G | | H | J | K | L | ; |
// Lsft/Z| X | C | V | B | | N | M | , | . |Rsft//|
// | LCTL | Bspc/LMOD | SPC | | Del/Num | Ent | Sym |
bindings = <
&kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P
&kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI
&mt LSHFT Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &mt RSHFT FSLH
&kp LCTRL &mt LGUI BSPC &kp SPACE &lt 1 DEL &kp RET &mo 2
>;
};
numbers {
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------
// 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |
// TAB | BT_PRV | BT_NXT | VOL-| VOL+| | < | v | ∧ | > | ' |
// Lsft| BT_SEL0| BT_CLR | MUTE| | | HOME| END | PGUP| PGDN| Rsft|
// | LCTL | LMOD| LALT | | Num | | BL-reset |
bindings = <
&kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0
&kp TAB &bt BT_PRV &bt BT_NXT &kp C_VOL_DN &kp C_VOL_UP &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp SQT
&kp LSHFT &bt BT_SEL 0 &bt BT_CLR &kp C_MUTE &none &kp HOME &kp END &kp PG_UP &kp PG_DN &kp RSHFT
&kp LCTRL &kp LGUI &kp LALT &trans &none &bootloader
>;
};
symbols {
// --------------------------------------------------------------------------------------------------------------------------------------------------------------------
// ESC | F1 | F2 | F3 | F4 | | OUT_USB | OUT_BLE | | = | - |
// CAPS| F5 | F6 | F7 | F8 | | [ | ] | | ` | \ |
// LSFT| F9 | F10 | F11 | F12 | | | | | | RSFT |
// | LCTL | LMOD| LALT | | RESET | | SYM |
bindings = <
&kp ESC &kp F1 &kp F2 &kp F3 &kp F4 &out OUT_USB &out OUT_BLE &none &kp EQUAL &kp MINUS
&kp CAPS &kp F5 &kp F6 &kp F7 &kp F8 &kp LBKT &kp RBKT &none &kp GRAVE &kp BSLH
&kp LSHFT &kp F9 &kp F10 &kp F11 &kp F12 &none &none &none &kp RSHFT
&kp LCTRL &kp LGUI &kp LALT &reset &none &trans
>;
};
};
};
11 changes: 11 additions & 0 deletions config/west.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
projects:
- name: zmk
remote: zmkfirmware
revision: main
import: app/west.yml
self:
path: config

0 comments on commit aafdba7

Please sign in to comment.