summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2022-01-08 10:31:44 -0500
committerKjetil Orbekk <kj@orbekk.com>2022-01-08 10:31:44 -0500
commit63927325857f1336be13b8d3ff9ddc549f95ae22 (patch)
treed12d4748af84a1b16da6d93ef4606f421c6242a6
Initial User Config.
-rw-r--r--.github/workflows/build.yml95
-rw-r--r--build.yaml16
-rw-r--r--config/planck_rev6.conf1
-rw-r--r--config/planck_rev6.keymap22
-rw-r--r--config/west.yml11
5 files changed, 145 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..4b57c4f
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -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:2.5
+ 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
diff --git a/build.yaml b/build.yaml
new file mode 100644
index 0000000..ad5fab6
--- /dev/null
+++ b/build.yaml
@@ -0,0 +1,16 @@
+# 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: planck_rev6
diff --git a/config/planck_rev6.conf b/config/planck_rev6.conf
new file mode 100644
index 0000000..9cbbd04
--- /dev/null
+++ b/config/planck_rev6.conf
@@ -0,0 +1 @@
+# Put configuration options here
diff --git a/config/planck_rev6.keymap b/config/planck_rev6.keymap
new file mode 100644
index 0000000..47e63dc
--- /dev/null
+++ b/config/planck_rev6.keymap
@@ -0,0 +1,22 @@
+#include <behaviors.dtsi>
+#include <dt-bindings/zmk/keys.h>
+
+/ {
+ keymap {
+ compatible = "zmk,keymap";
+
+ default_layer {
+// -----------------------------------------------------------------------------------------
+// | TAB | Q | W | E | R | T | Y | U | I | O | P | BSPC |
+// | ESC | A | S | D | F | G | H | J | K | L | ; | ' |
+// | SHIFT | Z | X | C | V | B | N | M | , | . | / | RET |
+// | FN | LGUI | LALT | LCTL | LOWR | SPACE | RAIS | LARW | DARW | UARW | RARW |
+ bindings = <
+ &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp DEL
+ &kp ESC &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
+ &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp BSLH &kp RET
+ &trans &kp LGUI &kp LALT &kp LCTRL &trans &trans &kp SPACE &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT
+ >;
+ };
+ };
+};
diff --git a/config/west.yml b/config/west.yml
new file mode 100644
index 0000000..379d291
--- /dev/null
+++ b/config/west.yml
@@ -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