forked from Bastardkb/qmk_userspace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathold_draw_keymaps.yaml
91 lines (75 loc) · 4.15 KB
/
old_draw_keymaps.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Keymap Drawer
on:
push:
branches:
- main # Change this to the branch you want to trigger the workflow on
jobs:
keymap-drawer:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11" # Ensure this matches the Python version you need
- name: Install pipx
run: |
python3 -m pip install --user pipx
python3 -m pipx ensurepath
export PATH="${HOME}/.local/bin:$PATH"
- name: Install keymap-drawer
run: |
pipx install keymap-drawer
- name: Install QMK CLI
run: |
python3 -m pip install --user qmk
echo "${HOME}/.local/bin" >> $GITHUB_PATH
export PATH="${HOME}/.local/bin:$PATH"
- name: Install required tools
run: |
sudo apt-get update
sudo apt-get install -y gcc-arm-none-eabi binutils-arm-none-eabi
sudo apt-get install -y gcc-avr binutils-avr avr-libc
sudo apt-get install -y avrdude
sudo apt-get install -y dfu-programmer
sudo apt-get install -y dfu-util
- name: Set up QMK environment
run: |
qmk setup -y
- name: Run qmk c2json
run: |
qmk c2json ${{ github.workspace }}/keyboards/bastardkb/charybdis/3x6/keymaps/akeyhd/keymap.c > ${{ github.workspace }}/keyboards/bastardkb/charybdis/3x6/keymaps/akeyhd/c2.json
- name: Run keymap parse
run: |
keymap parse -c 12 -q ${{ github.workspace }}/keyboards/bastardkb/charybdis/3x6/keymaps/akeyhd/c2.json > ${{ github.workspace }}/keyboards/bastardkb/charybdis/3x6/keymaps/akeyhd/keymap.yaml
- name: Replace problematic characters in keymap.yaml
run: |
sed -i "s/��/''/g" ${{ github.workspace }}/keyboards/bastardkb/charybdis/3x6/keymaps/akeyhd/keymap.yaml
- name: Run keymap-drawer for keymap.yaml
run: |
keymap -c ${{ github.workspace }}/keyboards/bastardkb/charybdis/3x6/keymaps/akeyhd/config.yaml draw ${{ github.workspace }}/keyboards/bastardkb/charybdis/3x6/keymaps/akeyhd/keymap.yaml > ${{ github.workspace }}/keyboards/bastardkb/charybdis/3x6/keymaps/akeyhd/keymap.svg
- name: Run keymap-drawer for keymapDesign.yaml
run: |
keymap -c ${{ github.workspace }}/keyboards/bastardkb/charybdis/3x6/keymaps/akeyhd/config.yaml draw ${{ github.workspace }}/keyboards/bastardkb/charybdis/3x6/keymaps/akeyhd/keymapDesign.yaml > ${{ github.workspace }}/keyboards/bastardkb/charybdis/3x6/keymaps/akeyhd/keymapDesign.svg
- name: Check for changes
id: git_status
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add ${{ github.workspace }}/keyboards/bastardkb/charybdis/3x6/keymaps/akeyhd/c2.json
git add ${{ github.workspace }}/keyboards/bastardkb/charybdis/3x6/keymaps/akeyhd/keymap.yaml
git add ${{ github.workspace }}/keyboards/bastardkb/charybdis/3x6/keymaps/akeyhd/keymap.svg
git add ${{ github.workspace }}/keyboards/bastardkb/charybdis/3x6/keymaps/akeyhd/keymapDesign.svg
if git diff-index --quiet HEAD; then
echo "No changes to commit"
echo "::set-output name=changes::false"
else
echo "Changes to commit"
echo "::set-output name=changes::true"
fi
- name: Commit and push updated files
if: steps.git_status.outputs.changes == 'true'
run: |
git commit -m "Update keymap JSON and SVG files"
git push